S
souporpower
This is my code to print the URL's from the browser favorites:
my @dirs = `dir`;
my $f;
foreach $f (@dirs) {
next if ($f =~ /url/);
`cd $f`;
print "Dir=" . $f . "\n";
# if ($f =~ /url/) {
# print "File=" . $f . "\n";
# open(FIN2, $f);
# while(<FIN2>) {
# print $_ if $_ =~ /http/;
# }
# close(FIN2);
# next;
# }
my @files=`dir *.url`;
my $f2;
foreach $f2 (@files) {
#chop $f2;
#chop $f2;
$f2 =~ s/\x0D//g;
print "AFile=" . "$f" . $f2 . "\n";
#my $file="$f\\$f2";
open(FIN, $f2);
while(<FIN>) {
print $_;
next if ($_ =~ /ico/);
print $_ if $_ =~ /http/ ;
}
close(FIN);
}
#`cd ..`;
}
The problem is each file returned by the DOS dir command has carriage
returns at the beginning of the file name (can't use chop or chomp).
Can someone please help me
out? Tried $f =~ s/^\\n//g;
my @dirs = `dir`;
my $f;
foreach $f (@dirs) {
next if ($f =~ /url/);
`cd $f`;
print "Dir=" . $f . "\n";
# if ($f =~ /url/) {
# print "File=" . $f . "\n";
# open(FIN2, $f);
# while(<FIN2>) {
# print $_ if $_ =~ /http/;
# }
# close(FIN2);
# next;
# }
my @files=`dir *.url`;
my $f2;
foreach $f2 (@files) {
#chop $f2;
#chop $f2;
$f2 =~ s/\x0D//g;
print "AFile=" . "$f" . $f2 . "\n";
#my $file="$f\\$f2";
open(FIN, $f2);
while(<FIN>) {
print $_;
next if ($_ =~ /ico/);
print $_ if $_ =~ /http/ ;
}
close(FIN);
}
#`cd ..`;
}
The problem is each file returned by the DOS dir command has carriage
returns at the beginning of the file name (can't use chop or chomp).
Can someone please help me
out? Tried $f =~ s/^\\n//g;