in reply to Re: regular expression with @@/
in thread regular expression with @@/

here is my revised code: (with parts edited out)
use warnings; use strict; my $file = shift or die "need filename from command-line"; open FH, '<', $file or die "could not open $file for reading: $!"; while( defined( my $line = <FH> )) { chomp $line; $line =~ m|\@\@/| && -f $line and do { ( $filename ) = $line =~ m|\A(.+)\@\@/|; chomp $line; print "$line -- "; next; }; }

Replies are listed 'Best First'.
Re^3: regular expression with @@/
by kennethk (Abbot) on Dec 07, 2009 at 18:30 UTC
    What file system are you on that / is a valid character in a file name? You presumably expect a regular file (-f) to end in @@/, which is presumably where your tests are failing. Perhaps this is a relative vs. absolute path issue?
      Am trying to write a quick utility script in Clearcase. The "@@/" allows us to grab versions of the file.