[ABE.pm] What's wrong with this?

Faber Fedor faber at linuxnj.com
Sat Mar 13 20:09:12 CST 2004


How come the first $arg= line works and the second one doesn't?

The file is called "untar" and the test is "untar fred.tgz".
And yes, those are backticks around the echo statement. :-)



#!/usr/bin/perl -w
use strict ;

die "Usage: ", $0 =~ /([^\/]+)$/, " <file_to_untar.(tgz|tar.gz)>\n"
        unless @ARGV == 1;

my $arg = shift ;

$arg =~  /.*tgz$/ and  print 'print is good!\n'   ; #works :-)
$arg =~  /.*tgz$/ and `echo -e 'echo is good!\n'` ; #doesn't :-(

-- 
 
Regards,
 
Faber                     

Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com






More information about the ABE-pm mailing list