Re: Writing into an MS-Access database

2008-04-09 Thread [EMAIL PROTECTED]
On Apr 9, 3:21 am, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > I am struck on how to write data into a MS-Access data base. > > > I know how to retrieve data. I am using Win32::ODBC -- fetchRow to > > retrieve a complete row. I need to write this

a port com sniffer (a like one)

2008-04-09 Thread [EMAIL PROTECTED]
      Hi everybody, I'm a very beginner in perl... sorry but I would like to write a script which read data on port comx, write it on po= rt comy and in a file... I also would like it can be done in both way (ie comx to comy and comy to c= omx). just like a com sniffer to intercept data on port

Re: How do I access module subroutines?

2008-04-09 Thread Jonathan Mast
Or I could just remove the $ from the call. $var1 = FOO::BAR::sub1(); works fine. I was referencing it like $FOO::BAR::sub1(); Thanks for the input however On Tue, Apr 8, 2008 at 1:12 PM, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Tue, 2008-04-08 at 12:24 -0400, Jonathan Mast wrote: >

Re: yesterday's time

2008-04-09 Thread Jay Savage
On Tue, Apr 8, 2008 at 6:21 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: "Jay Savage" <[EMAIL PROTECTED]> > > You probably meant something more like > > > > my $cal_r = [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]; #etc. > > > > But see the perlref and perlreftut for more i

Re: yesterday's time

2008-04-09 Thread Chas. Owens
2008/4/9 Jay Savage <[EMAIL PROTECTED]>: snip > my $ref = [EMAIL PROTECTED], [EMAIL PROTECTED]; > > creates a scalar as reference to an anonymous array, each of whose > elements is an arrayref. > > my @array = \(@array1, @array2); snip If you really need a reference then you can simply s

Example of FTP w/o Input file? Is it possible to do or not?

2008-04-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a hash which contains for each entry the email which I need to ftp to a particular location with a specified name. I could write out the file and then do the ftp. But since I have the necessary data in an audittrail report, I was wondering if I can ftp from a variable using ftp comma

Finish the script in the time i want

2008-04-09 Thread Armin Garcia
Hi well i have a problem, i need to terminate some script in 20 minutes, but i dont know how i can do this, i mean i run my script, but becouse this script executes another application the only way to stop this aplication is with "CTRL + C", but i want finish this script in 20 min and i dont want

Re: Finish the script in the time i want

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 1:42 PM, Armin Garcia <[EMAIL PROTECTED]> wrote: > Hi > > > well i have a problem, i need to terminate some script in 20 minutes, but i > dont know how i can do this, i mean i run my script, but becouse this script > executes another application the only way to stop this a

not grep

2008-04-09 Thread Johnson, Reginald (GTI)
In my code I am using grep successfully, but I would also like an output file that has the objects that don't match the grep. I am trying to capture the $line of my that don't match. I am thinking something like if ([EMAIL PROTECTED] = grep/\b$line\b/i,@mhsArray) { } #!/usr/bin/perl use warn

RE: Example of FTP w/o Input file? Is it possible to do or not?

2008-04-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Chas. Owens [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 09, 2008 12:33 > To: Wagner, David --- Senior Programmer Analyst --- WGO > Cc: beginners@perl.org > Subject: Re: Example of FTP w/o Input file? Is it possible to > do or not? > > On Wed, Apr 9, 20

Re: Example of FTP w/o Input file? Is it possible to do or not?

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 1:56 PM, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > I have a hash which contains for each entry the email which I > need to ftp to a particular location with a specified name. I could > write out the file and then do the ftp. Bu

Re: Example of FTP w/o Input file? Is it possible to do or not?

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 3:55 PM, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: snip > No. I want to do a put of a file, but without having to write > the file first > and then doing put(Filein,fileout). I could write out the 60 plus files > each time, but

How to extract digits by position in a string?

2008-04-09 Thread Michael Barnes
I have a list of strings like this: 060001_000 060001_001 060001_002 060001_003 060001_004 070002_000 070002_001 070002_002 070002_003 070002_004 The position and value of the digits are significant. The first two digits give me a channel, i.e. 06=channel 1, 07= channel 2, etc. The sixth digit

Re: How to extract digits by position in a string?

2008-04-09 Thread Jialin Li
substr($string,0,2) will give you the first two digits substr($string,5,1) will give you the sixth digit. On Wed, Apr 9, 2008 at 3:27 PM, Michael Barnes <[EMAIL PROTECTED]> wrote: > I have a list of strings like this: > > 060001_000 > 060001_001 > 060001_002 > 060001_003 > 060001_004 > 070002_0

Re: How to extract digits by position in a string?

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 4:27 PM, Michael Barnes <[EMAIL PROTECTED]> wrote: > I have a list of strings like this: > > 060001_000 > 060001_001 > 060001_002 > 060001_003 > 060001_004 > 070002_000 > 070002_001 > 070002_002 > 070002_003 > 070002_004 > > The position and value of the digits are

Re: not grep

2008-04-09 Thread Gunnar Hjalmarsson
Johnson, Reginald (GTI) wrote: In my code I am using grep successfully, But rather inefficient. A hash is a better tool to check for existence; see the FAQ entry "perldoc -q contained". but I would also like an output file that has the objects that don't match the grep. while (

Re: How to extract digits by position in a string?

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 4:31 PM, Jialin Li <[EMAIL PROTECTED]> wrote: > substr($string,0,2) will give you the first two digits > substr($string,5,1) will give you the sixth digit. snip There are at least three downsides to using the substr function: 1. multiple function calls 2. lots of typing 3.

Re: not grep

2008-04-09 Thread John W. Krahn
Johnson, Reginald (GTI) wrote: In my code I am using grep successfully, but I would also like an output file that has the objects that don't match the grep. I am trying to capture the $line of my that don't match. I am thinking something like if ([EMAIL PROTECTED] = grep/\b$line\b/i,@mhsArray

Sometimes Net::SSH2 can't read() from channel?

2008-04-09 Thread RICHARD FERNANDEZ
Hi folks, I have a test script ( mostly ripped from a posting I found on a CPAN forum) which uses Net::SSH2 to run a `who' command on a remote server. The script works fine for most servers, but I have a few boxes where, despite being able to login, I get no output. Anyone have any ideas why thi

Re: Sometimes Net::SSH2 can't read() from channel?

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 5:20 PM, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote: > Hi folks, > > I have a test script ( mostly ripped from a posting I found on a CPAN > forum) which uses Net::SSH2 to run a `who' command on a remote server. > The script works fine for most servers, but I have a few b

Re: How to extract digits by position in a string?

2008-04-09 Thread Jialin Li
Chas, Thank you for your remind. It is helpful. Best, Jialin On Wed, Apr 9, 2008 at 3:51 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Wed, Apr 9, 2008 at 4:31 PM, Jialin Li <[EMAIL PROTECTED]> wrote: > > substr($string,0,2) will give you the first two digits > > substr($string,5,1) will gi

Re: How to extract digits by position in a string?

2008-04-09 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On Wed, Apr 9, 2008 at 4:31 PM, Jialin Li <[EMAIL PROTECTED]> wrote: substr($string,0,2) will give you the first two digits substr($string,5,1) will give you the sixth digit. There are at least three downsides to using the substr function: 1. multiple function calls 2. lots

Re: not grep

2008-04-09 Thread Jenda Krynicky
From: Gunnar Hjalmarsson <[EMAIL PROTECTED]> > Johnson, Reginald (GTI) wrote: > > In my code I am using grep successfully, > > But rather inefficient. A hash is a better tool to check for existence; > see the FAQ entry "perldoc -q contained". > > > but I would also like an > > output file that

Re: not grep

2008-04-09 Thread Jenda Krynicky
From: "Johnson, Reginald \(GTI\)" <[EMAIL PROTECTED]> > In my code I am using grep successfully, but I would also like an > output file that has the objects that don't match the grep. I am trying > to capture the $line of my that don't match. > I am thinking something like if ([EMAIL PROTECTED] =

Re: Store hashes into array???

2008-04-09 Thread Jenda Krynicky
From: "Mr. Shawn H. Corey" <[EMAIL PROTECTED]> > On Wed, 2008-04-09 at 00:21 +0200, Jenda Krynicky wrote: > > From: [EMAIL PROTECTED] > > > I want to store a hash into an array: e.g.: like this > > > > > > #!/usr/bin/perl -v > > > > > > print "Content-type: text/html\n\n"; > > > >

Re: how to seperate the run time argument with | character

2008-04-09 Thread Jenda Krynicky
Subject:how to seperate the run time argument with | SEPARATE! > Hi, > > I have a perl script, where I am passing more than 3 arguments, but I > want to seperate them with |(pipe)or any other special charcater > instead of blank space, cause the argument itself I have the space

how to globalize a lexical variable inside a sub routine

2008-04-09 Thread itshardtogetone
Hi, Assuming my script use a strict pragma. If I have a lexical variable declared inside a sub routine and I wish to globalize this lexical variable, what are the various options to globalise this variable? Thanks ### use strict; use warnings; testing(); sub testing { my $var

Re: how to globalize a lexical variable inside a sub routine

2008-04-09 Thread Jenda Krynicky
From: <[EMAIL PROTECTED]> To: Subject:how to globalize a lexical variable inside a sub routine Date sent: Thu, 10 Apr 2008 07:30:32 +0800 > Hi, > Assuming my script use a strict pragma. > If I have a lexical variable declared inside a sub routine and I wish > to globalize this

Re: How to extract digits by position in a string?

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 7:14 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Chas. Owens wrote: snip > > There are at least three downsides to using the substr function: > > 1. multiple function calls > > 2. lots of typing > > 3. no guarantee that the input string is in the right format > > > >

Re: How to extract digits by position in a string?

2008-04-09 Thread Chas. Owens
On Wed, Apr 9, 2008 at 7:14 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Chas. Owens wrote: snip > > There are at least three downsides to using the substr function: > > 1. multiple function calls > > 2. lots of typing > > 3. no guarantee that the input string is in the right format > > > >

Re: how to globalize a lexical variable inside a sub routine

2008-04-09 Thread Chas. Owens
On Apr 9, 2008, at 19:30, <[EMAIL PROTECTED]> <[EMAIL PROTECTED] > wrote: Hi, Assuming my script use a strict pragma. If I have a lexical variable declared inside a sub routine and I wish to globalize this lexical variable, what are the various options to globalise this variable? Thanks ##

Re: How to extract digits by position in a string?

2008-04-09 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On Wed, Apr 9, 2008 at 7:14 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: Chas. Owens wrote: snip There are at least three downsides to using the substr function: 1. multiple function calls 2. lots of typing 3. no guarantee that the input string is in the right format

find files created/accessed in last n hours

2008-04-09 Thread nag
hi, please help me to get all the files present in a directory which are created/accessed in last 4 hours . thanks Nagesh -- Thanks Nagesh

Re: find files created/accessed in last n hours

2008-04-09 Thread Chas. Owens
On Thu, Apr 10, 2008 at 1:42 AM, nag <[EMAIL PROTECTED]> wrote: > hi, > please help me to get all the files present in a directory which are > created/accessed in last 4 hours . snip Take a look at File::Find* and the stat function** or -M***. You may also want to read perldoc -q "How do I get

Re: find files created/accessed in last n hours

2008-04-09 Thread J. Peng
use File::Find can do that. or use the unix 'find' command: find /path -type f -mmin -240 On 4/10/08, nag <[EMAIL PROTECTED]> wrote: > hi, > please help me to get all the files present in a directory which are > created/accessed in last 4 hours . > > > thanks > Nagesh > > -- > Thanks > Nagesh >

Re: find files created/accessed in last n hours

2008-04-09 Thread Gunnar Hjalmarsson
nag wrote: please help me to get all the files present in a directory which are created/accessed in last 4 hours . perldoc -f readdir perldoc -f grep perldoc -f -M -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: find files created/accessed in last n hours

2008-04-09 Thread nag
can some one please give the exact code for this.. thanks, Nagesh On Thu, Apr 10, 2008 at 11:31 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > nag wrote: > > > please help me to get all the files present in a directory which are > > created/accessed in last 4 hours . > > > >perldoc -f r

Re: find files created/accessed in last n hours

2008-04-09 Thread Chas. Owens
On Thu, Apr 10, 2008 at 2:48 AM, nag <[EMAIL PROTECTED]> wrote: > can some one please give the exact code for this.. snip No, we can provide you with rate cards for contract work, or you can take a stab at reading the docs and throwing together a script. If you have specific questions about the l