Help for this page

Select Code to Download


  1. or download this
    ...
    @a = qw| / /home/ /var/ /tmp/ /var/tmp/ |;
    # afaik ls doesn't care if there is a trailing slash for directories
    ...
    
  2. or download this
    ...
    @a = ('','/home','/var','/tmp','/var/tmp');
    @b = map { chomp(my @x = `ls $_/`);[@x]} @a;
    # $_ interpolates to `ls /` for @a[0]
    # do the same for the print statement