in reply to Difference between piped-in and invocation arguments to a Perl script?
Run that using your two methods, and note the difference. Also lookup chomp.#!/usr/bin/perl use warnings; use strict; my $value; if (defined $ARGV[0]) { $value = $ARGV[0]; } else { $value = <STDIN>; } print "<$value>\n";
|
|---|