regex puzzle

2005-07-28 Thread bingfeng zhao
See following sample code: use warnings; use strict; my @address = ("http://test";, "http://";, "www", "", "ftp:/foo" ); for (@address) { print "\"$_\" passed! \n" if /^((http|ftp):\/\/)?.+$/; } the running result is: "http://test"; is valid. "http://"; is valid. "www" is valid. "ftp:/

checking the reachability of the remote host

2005-07-28 Thread arjun.mallik
Hi , I have to verify whether the servers [windows , Linux ] which are integrated to my Unix machine are alive or not . I am using Net::Ping. Problem i am facing is , i am able to verify all Unix machines integrated . And not the Windows & Linux machines which integrated to my UNIX box. pl

Re: open > file && s/ / /;

2005-07-28 Thread John W. Krahn
Brian Volk wrote: > >>From: John W. Krahn [mailto:[EMAIL PROTECTED] >> >># store the files to "edit" in @ARGV >>@ARGV = map { chomp; "$dir/$_" } ; >> >># set the in-place edit variable >># cannot be '' on Windows >>$^I = '.bak'; >> >># modify the files and save the originals with .bak extention >>

Re: error message with net::FTP

2005-07-28 Thread Owen
On Thu, 28 Jul 2005 10:17:35 -0400 "Laurent Coudeur" <[EMAIL PROTECTED]> wrote: > I am having some trouble with net::FTP module > I get this error message > Timeout at /usr/lib/perl5/5.8/Net/FTP.pm line 1001 > > the script list directories in a path > then loops and list subdirectories > I can

Re: Getting Date Stamp of a file on a Win32 System

2005-07-28 Thread Robert
I found this maybe it will help: use strict; use File::stat; use POSIX qw(strftime); my $file = 'test.txt'; my $s = stat($file) || die "Can't stat($file) $!\n"; my $modtime = strftime('%Y-%m-%d', localtime($s->mtime)); print "Modification time of $file is $modt

RE: open > file && s/ / /;

2005-07-28 Thread Brian Volk
> -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 27, 2005 3:47 PM > To: Perl Beginners > Subject: Re: open > file && s/ / /; > > > Brian Volk wrote: > > Hi all, > > Hello, > > > Can someone pls take a look at the script below and explain >

Re: login shell?

2005-07-28 Thread Jay Savage
On 7/27/05, JupiterHost.Net <[EMAIL PROTECTED]> wrote: > > > Bryan R Harris wrote: > > > > Is there a way to determine in perl whether the current script was run from > > a login shell or not? > > if(-t STDIN) { > print "Hello terminal\n"; > } else { > print "Content-type: text/html\n\n"

Getting Date Stamp of a file on a Win32 System

2005-07-28 Thread Dave Adams
On a Win32 system, how do you get a date stamp of a file? I used: #!/usr/bin/perl -w use strict; use Data::Dumper; use File::stat; my $filename = "test.txt"; my $stat = stat($filename); print Dumper($stat); my $modified_time = stat($filename)->mtime; print ("The modified time of $filename is: $m

Re: Adding a library to @INC

2005-07-28 Thread Wiggins d'Anconia
Tom Allison wrote: > Wiggins d'Anconia wrote: > >> Normally you add to the @INC using the PERL5LIB environment variable. If >> "oracle>" represents a normal bash shell, then, >> >> export PERL5LIB="/path/to/lib/dir" >> >> Should do the trick. If it is actually the Oracle client then you might >> t

error message with net::FTP

2005-07-28 Thread Laurent Coudeur
Hi there, I am having some trouble with net::FTP module I get this error message Timeout at /usr/lib/perl5/5.8/Net/FTP.pm line 1001 the script list directories in a path then loops and list subdirectories I can connect and list files but as I try to ls into final sub-directory it hangs I get

Compiling Perl with Watcom

2005-07-28 Thread [EMAIL PROTECTED]
Hi, is there a way to compile Perl with Watcom (wmake). The Makefiles only seem to cover nmake and dmake, but not wmake. I tried it with the Makefile for nmake, but without success. Thanks in advance, Andre -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Re: MySQL in a for loop

2005-07-28 Thread David Van Ginneken
On 7/27/05, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: > David Van Ginneken wrote: > > : : #Get and process mail > : : for my $messageID (90){ > > : What exactly is this supposed to do? If you just run this > > : for my $messageID (90){ > : print $messageID . "\n

Re: Adding a library to @INC

2005-07-28 Thread Xavier Noria
On Jul 28, 2005, at 12:32, Tom Allison wrote: Wiggins d'Anconia wrote: Normally you add to the @INC using the PERL5LIB environment variable. If "oracle>" represents a normal bash shell, then, export PERL5LIB="/path/to/lib/dir" Should do the trick. If it is actually the Oracle client then y

RE: passing hash data from one subroutine to another using refs

2005-07-28 Thread Ankur Gupta
Brent Clark wrote: > Hi Hi, > Would someone please clear up / help me understand this. Sure. > I have a hash > > my %allTariffData = {}; I think you meant my %allTariffData = (); > and in my sub > > I have > my %tariffData = {}; Same here.. my %tariffData = ()

Re: Adding a library to @INC

2005-07-28 Thread Tom Allison
Wiggins d'Anconia wrote: Normally you add to the @INC using the PERL5LIB environment variable. If "oracle>" represents a normal bash shell, then, export PERL5LIB="/path/to/lib/dir" Should do the trick. If it is actually the Oracle client then you might try the same because *theoretically* the

passing hash data from one subroutine to another using refs

2005-07-28 Thread Brent Clark
Hi Would someone please clear up / help me understand this. I have a hash my %allTariffData = {}; and in my sub I have my %tariffData = {}; do the processing etc and then return \%tariffData; I now would like to use that data that in tariffData in another subroutine. Would a

Strange compilation error.

2005-07-28 Thread jhonnystecchino
When i compile perl 5.8.7 , 5.8.6 and 5.6.2, the compiler gives me always the same error: I type: ./Configure -d make and then the error appears: `sh cflags "optimize='-O2'" toke.o` toke.c CCCMD = cc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_Sl

Pinging from perl script

2005-07-28 Thread arjun.mallik
Hi , I have to verify whether the servers [windows , Linux ] which are integrated to my Unix machine are alive or not . I am using Net::Ping. Problem i am facing is , i am able to verify all Unix machines integrated . And not the Windows & Linux machines which integrated to my UNIX box. please

using ping on Net module

2005-07-28 Thread arjun.mallik
Hi , I have to verify whether the servers [windows , Linux ] which are integrated to my Unix machine are alive or not . I am using Net::Ping. Problem i am facing is , i am able to verify all Unix machines integrated . And not the Windows & Linux machines which integrated to my UNIX box.

using ping on Net module

2005-07-28 Thread arjun.mallik
Hi , I have to verify whether the servers [windows , Linux ] which are integrated to my Unix machine are alive or not . I am using Net::Ping. Problem i am facing is , i am able to verify all Unix machines integrated . And not the Windows & Linux machines which integrated to my UNIX box. please