opendir DIR, dir
while (defined(my $file=readdir(DIR))) {
next unless $file=~/\.mp3$/i ;
push(@files,$file);
}
works for me.
Omanakuttan N,
C,C++,Networking, perl, Linux
Tata Elxsi Ltd,
ph.8410 222 x 414.
---
' ...follow
I am trying to strip off ^Ms from a number of text files.
The following does not seem to work. any suggestions?
my $filename ;
while ($filename = shift) {
open (INF, $filename) or die Could not open $filename. $! ;
my @file = INF ;
close INF ;
open (OUT, $filename) or die Could not open
eg. To get all the unique elements of an array in linux I use a
simple one liner
@unique = grep{!/$seen{$_}++/} @all_elements;
The above expression did not work for me,
I could not even found out how this should work. So I created a small file
with...
@all_elements = qw(hello all
$myhash {23_59_54_20_08_2002} = [30,20,45] ;
my $x = $myhash{23_59_54_20_08_2002},\n ;
for my $i (0..$#{$x}) {
print $myhash{23_59_54_20_08_2002}-[$i], ;
}
print \n ;
HTH.
Om.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
open (FH, $filename) or die $! ;
my @arr = FH ;
HTH.
Om.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
if (($vbpcount==1) ||($dspcount==1))
{ die \n\nThe element ($PN) is not allowed to be added to
ClearCase,Because a project already exists.\n;
}
elsif(($vbpcount==1) ($dspcount==1))
{die \n\nThe element ($PN) is not allowed to be added to
ClearCase,Because
a project already exists.\n;
}