Re: Plz help

2005-10-11 Thread Le Sun (Sandy)

The Roopak Times wrote:


Hi All
As i was continuing with perl i created a program to churn out individual
directory names from a given path in windows.Here is the program:
#use warnings;
#use strict;
Print "Enter the path:";
my $dir=;
chomp($dir);
my @DIR=split ///, $dir;
print $DIR[0];
but it throws an error "Search pattern not terminated"
Plz help.

--
Thankx & Regards

Roopak Kr Prajapat

 


You need to use a slash to escaped - /\//


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: catchDate

2005-09-08 Thread Le Sun (Sandy)

Why not use `date' directly?If you want to use perl indeed,how about this:

#!/usr/bin/perl -w

system("date \"+Day: %d\"");

Christopher Spears wrote:


I want to catch the various parts of the output of the
date command.  Here is my script:

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

my $date = system("date");

$date =~ /(\w+)/;

my $day = $1;

print "Day: $day\n";

Here is my output:

Thu Sep  8 10:22:14 CEST 2005
Day: 0

What is going on?  Does this mean that nothing was
captured?

-Chris

 




--
Le Sun (Sandy.Sun)
Software Engineer
SUN China Engineering and Research Institute
CNS Platform Engineering China


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]