YAFZ has asked for the wisdom of the Perl Monks concerning the following question:
#!/bin/perl -w while (<>) { chomp; $line = join('', split /[ \t]*/); print $line; }
#!/bin/perl -w while (<>) { chomp; $line += split /[ \t]*/; } print $line;
$ ./ccount.pl <ccount.pl | wc 0 1 69
$ ./ccount2.pl <ccount.pl Use of implicit split to @_ is deprecated at ./ccount2.pl line 5. 72
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What is the difference?
by Thelonius (Priest) on Apr 08, 2003 at 14:45 UTC | |
by YAFZ (Pilgrim) on Apr 08, 2003 at 15:05 UTC | |
by dakkar (Hermit) on Apr 08, 2003 at 18:02 UTC | |
|
Re: What is the difference?
by hardburn (Abbot) on Apr 08, 2003 at 14:26 UTC | |
by jasonk (Parson) on Apr 08, 2003 at 14:30 UTC | |
|
Re: What is the difference?
by jasonk (Parson) on Apr 08, 2003 at 14:32 UTC | |
by YAFZ (Pilgrim) on Apr 08, 2003 at 14:51 UTC | |
|
Re: What is the difference?
by zby (Vicar) on Apr 08, 2003 at 14:29 UTC | |
by Abigail-II (Bishop) on Apr 08, 2003 at 14:38 UTC | |
by jasonk (Parson) on Apr 08, 2003 at 14:33 UTC |