Is there any way to squeeze the following into one line? (assume using
CGI.pm and that my $q = new CGI;):
$device = $q->param( "device_name" );
$device = $ARGV[0] if ! $device;
$device = "default_device" if ! $device;
i.e., first see if we're being used with a CGI form, if not -- see if we
have something from the command line, otherwise use a default value.
Or better yet, how about squeezing this into one line:
$device = $q->param( "device_name" );
$device = $ARGV[0] if ! $device;
chomp ( $device = <STDIN> ) if ! $device;
Not a critical question (the code works), but I am facinated with Perl
shortcuts...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>