Keedi Kim wrote:
> I watched Dr. Damian Conway's speech on OSCON 2008 movie clip.
> And I saw unfamiliar syntax.
>
> I know quoted words...
>
> my @list = qw;
>
> and I know @ARGV or filehandle with diamond operator...
>
> my @lines = <$fh>;
> my
I watched Dr. Damian Conway's speech on OSCON 2008 movie clip.
And I saw unfamiliar syntax.
I know quoted words...
my @list = qw;
and I know @ARGV or filehandle with diamond operator...
my @lines = <$fh>;
my $one_line = <>;
But this expression is very suprising...
my @list =
h @ARGV, @logs;
while( <> ) {
print "$filename:\n$_" if( /with errors/ );
}
Of course, my problem is that I'm not filling in $filename in that
print statement with a value. I'd really like to be able to put the
name of the file the diamond ('<>') operator is c
Larsen, Errin M HMMA/IT wrote:
So, the <> operator shift()s the filenames off the top of @ARGV?
That's usefull knowledge.
Yes, but it does it before the loop starts!
$ perl -le'
print for @ARGV;
print;
while (<>) { print "$ARGV\t$ARGV[0]" if $. == 1; close ARGV if eof }
print;
print for @
errors/ );
>>> }
>>>
>>> Of course, my problem is that I'm not filling in $filename in that
>>> print statement with a value. I'd really like to be able to put the
>>> name of the file the diamond ('<>') operator is currently p
<> ) {
print "$filename:\n$_" if( /with errors/ );
}
Of course, my problem is that I'm not filling in $filename in that
print statement with a value. I'd really like to be able to put the
name of the file the diamond ('<>') operator is currently parsing i
if( /with errors/ );
}
Of course, my problem is that I'm not filling in $filename in that print
statement with a value. I'd really like to be able to put the name of
the file the diamond ('<>') operator is currently parsing in there. Is
that possible? Do I have access
rint "$filename:\n$_" if( /with errors/ );
>>> }
>>>
>>> Of course, my problem is that I'm not filling in $filename in that
>>> print statement with a value. I'd really like to be able to put the
>>> name of the file the diamond (
;
> > Of course, my problem is that I'm not filling in $filename in that
> > print statement with a value. I'd really like to be able
> to put the
> > name of the file the diamond ('<>') operator is currently
> parsing in
> > there. Is th
gs;
> while( <> ) {
> print "$filename:\n$_" if( /with errors/ );
> }
>
> Of course, my problem is that I'm not filling in $filename in that
> print statement with a value. I'd really like to be able to put the
> name of the file the diamond ('&
my problem is that I'm not filling in $filename in that print
statement with a value. I'd really like to be able to put the name of
the file the diamond ('<>') operator is currently parsing in there. Is
that possible? Do I have access to the individual filenames AS th
John W. Krahn wrote:
>> i run the perlscript with a file suffix like:
>> ./perlscript test1.txt
>> i am trying to reverse the contents of test1.txt line-by-line and print
>> them out. but i dont get any output.any help would be appreciated.
>
>
> print reverse <>;
>
And they say perl is hard
T Kidwai wrote:
>
> hello everybody,
Hello,
> i needed some help with the diamond operator (<>)
> i am trying to use it in a while like so:
>
> while(<>){}
This reads all the lines from all the files listed in @ARGV and does
nothing with them.
> @somearray
hello everybody,
i needed some help with the diamond operator (<>)
i am trying to use it in a while like so:
while(<>){}
@somearray = reverse(@ARGV);
printf("@somearray");
i run the perlscript with a file suffix like:
./perlscript test1.txt
i am trying to reverse the cont
14 matches
Mail list logo