Re: Diamond operator and quoted word?

2008-07-24 Thread Rob Dixon
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

Diamond operator and quoted word?

2008-07-23 Thread Keedi Kim
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 =

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
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

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
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 @

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
<> ) { 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

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
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

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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 (

RE: Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
; > > 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

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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 ('&

Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
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

Re: diamond operator

2002-10-04 Thread Todd Wade
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

Re: diamond operator

2002-10-03 Thread John W. Krahn
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

diamond operator

2002-10-03 Thread T Kidwai
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