Re: Returning one item out of a list

2002-04-03 Thread Michael Kelly
Thanks all! I knew it was something like that. Parenths, not curlies... And thanks for the ref on File::Basename, too. Looks like I won't have to reinvent the wheel on that one. :) Thanks, -- Michael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT

RE: Returning one item out of a list

2002-04-03 Thread Wagner-David
You can try: $path = 'd:/ab/c/de/fgh/file.txt'; my $filename = (split(/\//,$path))[-1]; printf "%-s\n", $filename; which prints file.txt Wags ;) -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 22:14 To: 'Michael Kelly '; [EMA

RE: Returning one item out of a list

2002-04-03 Thread Timothy Johnson
I think what you're looking for is something like this: my $filename = split(/\//,$path)[7]; #assuming you want the seventh item I don't know how you would get the last one if you didn't know how many there were, though. Disclaimer: I haven't tested this. Use at your own risk. Do not expos

Re: Returning one item out of a list

2002-04-03 Thread Peter Scott
At 09:17 PM 4/3/02 -0800, Michael Kelly wrote: >Hey all, > >I seem to remember seeing this done somewhere, but now I can't figure out >how to do it now. > >If you have a function that returns a list, such as split(), is there a way >to only return one item from that list, as if you were working wi

read and write to parallel port

2002-04-03 Thread Marco Centemeri
Hello - I need to write and read to a parallel port and its registers; have Somebody an idea about how to do it? I'm using WinNT and Win2000. Thanks Marco Centemeri -- Eng. MARCO CENTEMERI Telecommunication and Peripherals/

Returning one item out of a list

2002-04-03 Thread Michael Kelly
Hey all, I seem to remember seeing this done somewhere, but now I can't figure out how to do it now. If you have a function that returns a list, such as split(), is there a way to only return one item from that list, as if you were working with an array? For instance, if you have something like

RE: Stripping digits from a variable...

2002-04-03 Thread Timothy Johnson
Showoff! :) -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 7:24 PM To: [EMAIL PROTECTED] Subject: Re: Stripping digits from a variable... Daniel Falkenberg wrote: > > Hey all, Hello, > I have a variable that prints... 2002 > > I w

Re: Trying to add things to an array , but it has blank spaces

2002-04-03 Thread bob ackerman
you might trying printing the values to see what you are getting. print $row[0]; are you getting as many rows as you expect? check the length of $array_ref print @$array_ref; On Wednesday, April 3, 2002, at 06:25 PM, FLAHERTY, JIM-CONT wrote: > Hello, It seams I am sucessfully adding numbers

Re: Stripping digits from a variable...

2002-04-03 Thread John W. Krahn
Daniel Falkenberg wrote: > > Hey all, Hello, > I have a variable that prints... 2002 > > I want to strip the first two digits from that. Could someone give me a > hand with that. At the moment I have ... > > $year = "2002"; > > $year =~ s//20/; > > Is there a more precise way of doing tha

Re: weird characters

2002-04-03 Thread Michael Kelly
On 4/3/02 4:02 PM, Pedro A Reche Gallardo <[EMAIL PROTECTED]> wrote: > Hi, I have a cgi script that uploads files but I have found that when > those files are uploaded from a Mac or Windows the return character > (maybe other characters too) are replaced by something else. Does any > one know how

RE: Stripping digits from a variable...

2002-04-03 Thread Timothy Johnson
All lectures about Y2k aside, you could do it with sprintf() or a regex: if($var =~ /^\d{2}(\d{2})/){#two digits followed by two digits $var = $1; #set $var as match in parentheses }else{ die "Variable has invalid format!\n"; } -Original Message- From: Daniel Falkenberg [mailto:[

Re: Stripping digits from a variable...

2002-04-03 Thread Tanton Gibbs
I would probably use substr $year = substr( $year, 2 ); - Original Message - From: "Daniel Falkenberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 03, 2002 9:54 PM Subject: Stripping digits from a variable... > Hey all, > > I have a variable that prints... 2002

RE: Cant open file...

2002-04-03 Thread Timothy Johnson
Don't feel too bad. I wish I could reclaim the hours wasted by forgetting to escape backslashes. :P -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 6:53 PM To: Timothy Johnson Cc: [EMAIL PROTECTED] Subject: RE: Cant open file.

Stripping digits from a variable...

2002-04-03 Thread Daniel Falkenberg
Hey all, I have a variable that prints... 2002 I want to strip the first two digits from that. Could someone give me a hand with that. At the moment I have ... $year = "2002"; $year =~ s//20/; Is there a more precise way of doing that? Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTE

Re: Cant open file...

2002-04-03 Thread Michael Kelly
On 4/3/02 6:47 PM, Daniel Falkenberg <[EMAIL PROTECTED]> wrote: > Well I think I have figured it out... > > The location of my file looked like this... > > $file = "c:\folder\folder\test.cgi"; > > Now this didn't work like this so I changed it to... > > $file = 'c:\folder\folder\test.cgi'; >

RE: Cant open file...

2002-04-03 Thread Daniel Falkenberg
Of coarse I had no problem with the linux box... :) -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, 4 April 2002 12:14 PM To: Daniel Falkenberg; Timothy Johnson Cc: [EMAIL PROTECTED] Subject: RE: Cant open file... Ah. There's your problem. Perl th

RE: Cant open file...

2002-04-03 Thread Timothy Johnson
Ah. There's your problem. Perl thinks you're trying to escape characters. Perl sees "c:(formfeed)older(formfeed)older(tab)est.cgi". If you are going to use backslashes, you have to do double-backslashes. "c:\\folder\\folder\\test.cgi". Of course, Perl will also know what you mean if you use

Re: Cant open file...

2002-04-03 Thread Tanton Gibbs
I would assume it is because "\f" is a form feed while '\f' is two characters, a backslash and an f. - Original Message - From: "Daniel Falkenberg" <[EMAIL PROTECTED]> To: "Timothy Johnson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 03, 2002 9:47 PM Subject: RE: Ca

RE: Cant open file...

2002-04-03 Thread Daniel Falkenberg
Well I think I have figured it out... The location of my file looked like this... $file = "c:\folder\folder\test.cgi"; Now this didn't work like this so I changed it to... $file = 'c:\folder\folder\test.cgi'; Now it works fine. I don't really know why but as long as it works :) Regards, Dan

Trying to add things to an array , but it has blank spaces

2002-04-03 Thread FLAHERTY, JIM-CONT
Hello, It seams I am sucessfully adding numbers to my array , but in turn tey are blank spaces. I need Help My code $dbh =DBI ->connect($data_source, $username, $password) or die "cant connect to $data_source : my $dbh-> errstr\n"; my $sth1 = $dbh -> prepare("select num from tests where subj

RE: Cant open file...

2002-04-03 Thread Timothy Johnson
You really haven't given us much to go on, but I guess you might double-check to see if there are spaces in the filename, or if you have a \n in there somewhere. -Original Message- From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 6:04 PM To: [EMAIL PROTE

Cant open file...

2002-04-03 Thread Daniel Falkenberg
Hi all, Just wondering why this error message is appearing on my windows box. I can read the file okay on a Linux box but when I ported my program to the Windows box I am not receiving the following error message. I have set the permissions on the file the full access to everyone (For testing p

RE: weird characters

2002-04-03 Thread Timothy Johnson
I'm not 100% sure on the Mac, but I know that Windows puts a CRLF (\r\n) instead of just the unix newline (\n). -Original Message- From: Pedro A Reche Gallardo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 4:03 PM To: [EMAIL PROTECTED] Subject: weird characters Hi, I hav

Re: write file in cgi file

2002-04-03 Thread bob ackerman
but i am just trying to write to a file my perl script is creating. i am not allowing a user of the web page to create a file of their choosing. or put their own file in my cgi-bin. so you are saying on a normal website, scripts can't create even temp files? On Wednesday, April 3, 2002, at 02:0

weird characters

2002-04-03 Thread Pedro A Reche Gallardo
Hi, I have a cgi script that uploads files but I have found that when those files are uploaded from a Mac or Windows the return character (maybe other characters too) are replaced by something else. Does any one know how to avoid this? or alternatively, how can I translate those characters into

Re: Loop

2002-04-03 Thread Jeff 'japhy' Pinyan
On Apr 3, Mandar Rahurkar said: >I want files labeled band_1_train_but_1_neutral.txt >from 7 to 16 >@loop=(7, 8, 9, 10, 11, 12, 13, 14, 15, 16); >foreach $no (@loop) > { >$file_list=$list."/band_$no_train_but_1_neutral.txt"; Perl is seeing the variable $no_train_but_1_neutral, instead of j

Loop

2002-04-03 Thread Mandar Rahurkar
I want files labeled band_1_train_but_1_neutral.txt from 7 to 16 why does this work ? Please let me knoe. @loop=(7, 8, 9, 10, 11, 12, 13, 14, 15, 16); foreach $no (@loop) { $file_list=$list."/band_$no_train_but_1_neutral.txt"; print $file_list,"\n"; } Mandar -- To unsubscribe, e-m

Re: Opening a datafile

2002-04-03 Thread drieux
On Wednesday, April 3, 2002, at 01:43 , John W. Krahn wrote: > Drieux wrote: >> >> On Wednesday, April 3, 2002, at 01:09 , Allison Ogle wrote: >> [..] >>> However, if I didn't know the name of the datafile how would I open it? >>> I >>> tried $inputFile="(*).dat"; and $inputFile="*.dat"; but n

Re: DBI vs. piping query to Mysql

2002-04-03 Thread Peter Scott
At 04:28 PM 4/3/02 -0500, Kevin Old wrote: >Hello all, > >I am a consultant brought in to manage and restructure some Perl scripts that >were written some time ago. The programmer at that time was using the >following code to do a query from within a CGI page. > > ${query} = "SELECT ccyymmdd

Re: Use of unitialized value error.

2002-04-03 Thread drieux
On Wednesday, April 3, 2002, at 02:33 , John W. Krahn wrote: [..] >> -snap- [..] >> Use of uninitialized value at /qmds/jbalint/20020128/datsample.pl line >> 47, >> chunk 478985. [..] Good EYE!!! > How many elements does @random_numbers have? It looks like you are > trying to read pa

Perl setup

2002-04-03 Thread Brian Johnson
Somewhere along the way I've screwed up my perl setup it's looking for modules in i586-linux and /usr/local/lib/perl5 directories instead of i586-linux and /usr/lib/perl5 Can anyone tell what settings I need to change? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Win32 Perl editors (was: Perl 6?)

2002-04-03 Thread David Gray
For all you win32 perl hackers, I've been using a really cool editor called Code-Genie: for about a month now, which allows customizable nested syntax highlighting! I definitely recommend it, and I'll post my syntax customization file if anyone's interested. Cheers, -da

Re: Use of unitialized value error.

2002-04-03 Thread John W. Krahn
Jess Balint wrote: > > Hello, I have been getting an error in my code for a reason that I cannot > understand. The code looks like this: > > -snip- > > $\ = ":"; > foreach( @random_numbers ) { print; } > > open( INFILE, $opt_i ) or die( "Cannot open $opt_i: $!" ); > open( OUTFILE, "> $

Re: Printing output to an Existing HTML file

2002-04-03 Thread Jenda Krynicky
From: Kojo Idrissa <[EMAIL PROTECTED]> > This is probably a simple question, but I can't seem to find a simple > answer. I'm pretty new to Perl, but I'm learning. > > I've written a small program that performs a calculation, and I want > the result to be displayed on my home pa

Re: Reading lines from a file

2002-04-03 Thread John W. Krahn
Mark Anderson wrote: > > #open FILE or die... > my $location = ; > my $format = ; > my $cost = ; > my $start = ; > my $runby = ; > my $prize = ; > > now you have each of the 6 lines in its own variable. You can then use the > variables to lay out your HTML. And of course you can put it all on

Printing output to an Existing HTML file

2002-04-03 Thread Kojo Idrissa
Hello all, This is probably a simple question, but I can't seem to find a simple answer. I'm pretty new to Perl, but I'm learning. I've written a small program that performs a calculation, and I want the result to be displayed on my home page. I'd also like the calculation to be redone each

Re: Setting hash values equal to zero

2002-04-03 Thread John W. Krahn
Michael Stearman wrote: > > Hi! Hello, > I have a hash and I want to set all the values equal to zero. I want to > keep the keys as they are though. Anyone know how? Here is one way to do it: $ perl -le' my %hash = ( a => int(rand 999)+1, b => int(rand 999)+1, c => int(rand 999)+1,

Re: Perl 6?

2002-04-03 Thread Chas Owens
On Wed, 2002-04-03 at 17:04, Jenda Krynicky wrote: > From: Chas Owens <[EMAIL PROTECTED]> > > On Wed, 2002-04-03 at 16:09, Nikola Janceski wrote: > > > I just found out that Perl 6 is going to be mainly OO (object > > > oriented for you beginners). Can someone give me a direct URL of > > > where I

RE: Perl 6?

2002-04-03 Thread Timothy Johnson
Ew. My thoughts exactly. I don't envy the beginners, though. Just think of all the frustration that will be caused by searching through old webpages trying to figure out why the code doesn't work. -Original Message- From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] Sent: Wednesday,

RE: Use of unitialized value error.

2002-04-03 Thread Balint, Jess
Sorry about that. See below. -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 5:08 PM To: Balint, Jess Cc: '[EMAIL PROTECTED]' Subject: Re: Use of unitialized value error. On Wed, 2002-04-03 at 16:44, Balint, Jess wrote: > Hello, I have been

Re: Use of unitialized value error.

2002-04-03 Thread Chas Owens
On Wed, 2002-04-03 at 16:44, Balint, Jess wrote: > Hello, I have been getting an error in my code for a reason that I cannot > understand. The code looks like this: > > -snip- > > $\ = ":"; > foreach( @random_numbers ) { print; } > > open( INFILE, $opt_i ) or die( "Cannot open $opt_i: $

Re: write file in cgi file

2002-04-03 Thread drieux
On Wednesday, April 3, 2002, at 10:17 , bob ackerman wrote: > no one answered. i see the problem, too. > can't open for write/create a file in a cgi script called from browser. > i assume because www user doesn't have write permission in cgi-bin? if your sys admin allowed your cgi to save files

Re: Setting hash values equal to zero

2002-04-03 Thread Chas Owens
On Wed, 2002-04-03 at 17:00, Michael Stearman wrote: > > > Hi! > > I have a hash and I want to set all the values equal to zero. I want to > keep the keys as they are though. Anyone know how? > Thanks, > Mike. $hash{$_} = 0 for keys %hash; is one way -- Today is Pungenday the 20th day o

RE: Perl 6?

2002-04-03 Thread Chas Owens
On Wed, 2002-04-03 at 16:47, Nikola Janceski wrote: > It has also been told to me that Perl 6 will have a command line arg to run > scripts written for older Perl releases (ie. 5.6.1). > > Does that mean if I wish to enhance/modify some code that I might as well > re-write it for OO in Perl 6? >

Re: Perl 6?

2002-04-03 Thread Jenda Krynicky
From: Chas Owens <[EMAIL PROTECTED]> > On Wed, 2002-04-03 at 16:09, Nikola Janceski wrote: > > I just found out that Perl 6 is going to be mainly OO (object > > oriented for you beginners). Can someone give me a direct URL of > > where I can find what is really going to happen? I do lots of Perl >

RE: Setting hash values equal to zero

2002-04-03 Thread Timothy Johnson
You mean like this? foreach(keys %hash){ $hash{$_} = 0; } -Original Message- From: Michael Stearman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: Setting hash values equal to zero Hi! I have a hash and I want to set all the val

Re: Looping over Hashes of Arrays

2002-04-03 Thread John W. Krahn
James Taylor wrote: > > How do you get a list of all keys in a hash of arrays? I'll have a hash > where the data would look something > like: > > %myhash = ('client19' => [ 'client2', 'client5', 'client7' ], >'client20' => [ 'client3', 'client4', 'client8' ]); > > I need to basical

RE: Reading lines from a file

2002-04-03 Thread Mark Anderson
#open FILE or die... my $location = ; my $format = ; my $cost = ; my $start = ; my $runby = ; my $prize = ; now you have each of the 6 lines in its own variable. You can then use the variables to lay out your HTML. -Original Message- From: Glenn Cannon [mailto:[EMAIL PROTECTED]] Sent:

Setting hash values equal to zero

2002-04-03 Thread Michael Stearman
Hi! I have a hash and I want to set all the values equal to zero. I want to keep the keys as they are though. Anyone know how? Thanks, Mike. _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsub

Use of unitialized value error.

2002-04-03 Thread Balint, Jess
Hello, I have been getting an error in my code for a reason that I cannot understand. The code looks like this: -snip- $\ = ":"; foreach( @random_numbers ) { print; } open( INFILE, $opt_i ) or die( "Cannot open $opt_i: $!" ); open( OUTFILE, "> $opt_o" ) or die( "Cannot open $opt_o: $!"

Re: Looping over Hashes of Arrays

2002-04-03 Thread Chas Owens
On Wed, 2002-04-03 at 16:42, James Taylor wrote: > How do you get a list of all keys in a hash of arrays? I'll have a hash > where the data would look something > like: > > %myhash = ('client19' => [ 'client2', 'client5', 'client7' ], > 'client20' => ['client3', 'client4',

RE: Perl 6?

2002-04-03 Thread Nikola Janceski
It has also been told to me that Perl 6 will have a command line arg to run scripts written for older Perl releases (ie. 5.6.1). Does that mean if I wish to enhance/modify some code that I might as well re-write it for OO in Perl 6? And now all my syntax highlight patterns for my editor (nedit)

Re: Opening a datafile

2002-04-03 Thread John W. Krahn
Drieux wrote: > > On Wednesday, April 3, 2002, at 01:09 , Allison Ogle wrote: > [..] > > However, if I didn't know the name of the datafile how would I open it? I > > tried $inputFile="(*).dat"; and $inputFile="*.dat"; but neither works. > > Does anyone have any ideas? Thanks, > > ### #!/usr/b

Re: Perl 6?

2002-04-03 Thread Chas Owens
On Wed, 2002-04-03 at 16:28, Chas Owens wrote: > On Wed, 2002-04-03 at 16:09, Nikola Janceski wrote: > > I just found out that Perl 6 is going to be mainly OO (object oriented for > > you beginners). > > Can someone give me a direct URL of where I can find what is really going to > > happen? I do

Looping over Hashes of Arrays

2002-04-03 Thread James Taylor
How do you get a list of all keys in a hash of arrays? I'll have a hash where the data would look something like: %myhash = ('client19' => [ 'client2', 'client5', 'client7' ], 'client20' => ['client3', 'client4', 'client8']); I need to basically get a list of the hash val

Re: Opening a datafile

2002-04-03 Thread John W. Krahn
Allison Ogle wrote: > > Hi, Hello, > I am trying to figure out how to open a datafile without knowing the name of > the datafile. For example, using the below code, I can open the datafile > LogFile.dat from the folder where the script is located. Both the script > and LogFile.dat are saved i

Re: Perl 6?

2002-04-03 Thread Chas Owens
On Wed, 2002-04-03 at 16:09, Nikola Janceski wrote: > I just found out that Perl 6 is going to be mainly OO (object oriented for > you beginners). > Can someone give me a direct URL of where I can find what is really going to > happen? I do lots of Perl programming and I really want to determine i

RE: Perl 6?

2002-04-03 Thread Hanson, Robert
Here is the dev site. http://dev.perl.org/perl6/ The Apocalypses are written by Larry Wall and describe the way things will work in Perl 6, the Exegeses are written by Damian Conway where he gives examples of what Larry is taking about. The RFC's are proposed changes submitted by the Perl commu

DBI vs. piping query to Mysql

2002-04-03 Thread Kevin Old
Hello all, I am a consultant brought in to manage and restructure some Perl scripts that were written some time ago. The programmer at that time was using the following code to do a query from within a CGI page. ${query} = "SELECT ccyymmddhh FROM inventory ORDER BY ccyymmddhh ;" ;

Re: Opening a datafile

2002-04-03 Thread drieux
On Wednesday, April 3, 2002, at 01:09 , Allison Ogle wrote: [..] > However, if I didn't know the name of the datafile how would I open it? I > tried $inputFile="(*).dat"; and $inputFile="*.dat"; but neither works. > Does > anyone have any ideas? Thanks, > > Allison ### #!/usr/bin/perl ### ##

RE: Reading lines from a file

2002-04-03 Thread Glenn Cannon
I have a six line file with base data in. I am trying to use that data to create HTML code. Data looks like LOCATION FORMAT COST START TIME RUN BY PRIZE When I create the HTML some of these will be on the same line, others will be separated by a . I want to be able to bring in each line int

RE: Reading lines from a file

2002-04-03 Thread Mark Anderson
Specific by line number? specific by text in the line? specific as line-by-line? Please be more specific. :) To read line $x of FILE into $line: foreach 2..$x; $line = reads in the next line of the file. Hope this helps, /\/\ark -Ori

Re: log file question

2002-04-03 Thread Jeff 'japhy' Pinyan
On Apr 3, Hans Holtan said: >I don't know if this is too general for your purposes, but this >should look through a whole file and find anyplace that the word >"running" appear in three consecutive lines. Actually, the /g switch there might make it break; I'd remove it. > ($all_

Opening a datafile

2002-04-03 Thread Allison Ogle
Hi, I am trying to figure out how to open a datafile without knowing the name of the datafile. For example, using the below code, I can open the datafile LogFile.dat from the folder where the script is located. Both the script and LogFile.dat are saved in the same folder therefore the below cod

Perl 6?

2002-04-03 Thread Nikola Janceski
I just found out that Perl 6 is going to be mainly OO (object oriented for you beginners). Can someone give me a direct URL of where I can find what is really going to happen? I do lots of Perl programming and I really want to determine if this is going to be a good thing, or bad. I really don't

Re: NEW!!

2002-04-03 Thread Chas Owens
If you already have Perl installed then you have some of the best docs available right at your fingertips; just run 'perldoc perl' for more info. On Wed, 2002-04-03 at 15:47, [EMAIL PROTECTED] wrote: > Hi All, > > I am new to Perl .Can anyone suggest me the sites from where i can download t

Reading lines from a file

2002-04-03 Thread Glenn Cannon
How do I read a specific line from a text file? I know how to open and close the file, and how to read the entire file, is there a way (maybe by setting $.) to read a specific line of the file?

Re: NEW!!

2002-04-03 Thread Tyler Longren
www.perldoc.com is good. Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 03, 2002 2:47 PM Subject: NEW!! > Hi All, > > I am new to Perl .Can anyone suggest

NEW!!

2002-04-03 Thread
Hi All, I am new to Perl .Can anyone suggest me the sites from where i can download the documentation and related information. Thanks in advance Regards, madhukar e-mail: [EMAIL PROTECTED] --- Pioneer Online Pvt. Ltd. --The most realiable Internet Service Provider of AP.

Re: log file question

2002-04-03 Thread Hans Holtan
Hi Lance, I don't know if this is too general for your purposes, but this should look through a whole file and find anyplace that the word "running" appear in three consecutive lines. open (INFILE, "+; for (0 .. ($#all_lines-2)){ if ( ($all_lines[$_] =~ m/running/gi) a

Checking new files on directories

2002-04-03 Thread acj1234
I´m need do launch a action when new files to income on a specific directory. I don´t want to use the cron in this task, I need to write a script for listen files incoming and launch the action. Something like "tail -f | ls -l", but frequently. How can I implement this in Perl ? Thanks -- To un

RE: glob

2002-04-03 Thread Mandar Rahurkar
Thanks a lot everyone for all youe help.But does someone know why this happens ? its been troubling me for quite some time now > why does this work ? > glob "*d[23456]*_vow*.fea" > while > glob "*d[^1]*_vow*.fea" Many Thanks Mandar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: glob

2002-04-03 Thread Timothy Johnson
Why do you not want to use a loop? You want to append a string to the beginning of each element of an array. That's the best excuse for a loop I can think of. Am I missing something? foreach(@files){ $_ = $dir_of_files.$_; } -Original Message- From: Mandar Rahurkar [mailto:[EMAIL

Re: glob

2002-04-03 Thread Jeff 'japhy' Pinyan
On Apr 3, Mandar Rahurkar said: >i have a list >@files; >$dir_of_files; > >i wanna have a list : > >@completepath= $dir_of_files.@files; > >However this doesnt work : > >can i do this w/o using a loop ; Well, you'll be able to do it without a loop in Perl 6, but we don't have Perl 6 yet, so you'

Re: Beginner in Perl

2002-04-03 Thread Craig Sharp
You need to have a web server installed. The scripts are then put into the cgi-bin directory and accessed from a browser like this: http://host.com/cgi-bin/script.pl or http://host.com/cgi-bin/script.cgi IIS will handle cgi scripts just fine. See you documentation on setup. Craig A. Sharp Un

Re: open3

2002-04-03 Thread Jonathan E. Paton
Rasoul Hajikhani wrote [with rearrangement]: > I am using open3 to create a commumnication > channel to gnupg. I am writing a web based > interface for encrypting and decrypting > files. I am having a lot of trouble with > decrypting messages. open3 is evil. If you can avoid it, do. Else lis

Accessing an Access Database on Linux

2002-04-03 Thread Kanchana Weerasinghe
I need to access a MS Access Database residing on a Linux box and perform some queries. Any suggestions? Thanks in advance.

Beginner in Perl

2002-04-03 Thread Adriano Sastre Vieira
Hello list. I'm a absolute beginner in Perl. I have some questions about it: 1. I have installed Perl in my machine - windows 2000. It creates a dir c:\Perl\bin 2. How do I run the samples scripts in the browser? For example, in dir C:\Perl\eg\Core\cgi have a lot of samples. 3. If I type "pe

Re: Filehandles named with a variable

2002-04-03 Thread Peter Scott
At 03:48 PM 4/2/02 -0600, Mr Hash wrote: >So, I'm trying to 'open ($1,">>$file")', where $1 is a string like >"cbQosCMPrePolicyPktOverflow". > >Obviously, with use strict this does not work. How can I make it work? I >need arbitrarily named filehandles. I know, it could get rended with >gobblewort

open3

2002-04-03 Thread Rasoul Hajikhani
Hello folks, I am using open3 to create a commumnication channell to gnupg. I am writing a web based interface for encrypting and decrypting files. I am having a lot of trouble with decrypting messages. Here is a piece of code form my programme: # This is actual code in perl $cmd = "--hom

glob

2002-04-03 Thread Mandar Rahurkar
why does this work ? glob "*d[23456]*_vow*.fea" while glob "*d[^1]*_vow*.fea" How do we negate in glob ? One more question : i have a list @files; $dir_of_files; i wanna have a list : @completepath= $dir_of_files.@files; However this doesnt work : can i do this w/o using a loop ; Thanks Man

write file in cgi file

2002-04-03 Thread bob ackerman
no one answered. i see the problem, too. can't open for write/create a file in a cgi script called from browser. i assume because www user doesn't have write permission in cgi-bin? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

[OT] Re: how make a function not blocking...

2002-04-03 Thread Jenda Krynicky
From: "Jonathan E. Paton" <[EMAIL PROTECTED]> > Fabrizio Morbini <[EMAIL PROTECTED]> wrote: > > Hi at all, > > Opps, I assume you meant "Hi et all", but that is latin for "Hi and > all"... implying a name/group between "Hi" and "et"... such as: > > Hi humamiod lifeforms et all, I'd thing that m

RE: AdminMisc

2002-04-03 Thread Timothy Johnson
If you are using ActiveState's ActivePerl, Dave Roth has his own PPM repository. PPM> set repository dave http://www.roth.net/perl/packages PPM> set save PPM> install win32-adminmisc Another repository you might want to check out is http://jenda.krynicky.cz/perl. You can find the Win32::Lanman

RE: Perl dates

2002-04-03 Thread Timothy Johnson
Check out the Time::Local module. -Original Message- From: Ho, Tony [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 8:45 AM To: [EMAIL PROTECTED] Subject: Perl dates Hi guys, I was wondering if you could help me. I have a variable in my perl code called $deadline_date. I ass

Perl dates

2002-04-03 Thread Ho, Tony
Hi guys, I was wondering if you could help me. I have a variable in my perl code called $deadline_date. I assign $deadline_date the value 20011212. The date format is MMDD. I have a file which contains 2 columns of values i.e. date and product as follows: 20011001 abc 20010701 bcd 20011101

Re: getting several files into a single array

2002-04-03 Thread drieux
On Wednesday, April 3, 2002, at 08:26 , patrick hall wrote: check yesterday's discussion about using a hash here. > I've tried using glob, but I can only get the file > _names_ into the array, not contents. I guess I could > just write three separate opens [i.e., open(FH1, > "file1.txt") and so

Re: getting several files into a single array

2002-04-03 Thread John W. Krahn
Patrick Hall wrote: > > Hi, > > I've written a script with a run-of-the-mill open in > it, like this: > > $file = "myfile.txt"; > open(FH, $file); You should always check the return from open. open FH, $file or die "Cannot open $file: $!"; > @lines = ; > close(FH); > > Now I'd like to modi

AdminMisc

2002-04-03 Thread Ned Cunningham
Does anyone know where I can get the AdminMisc extension? And what is the procedure to download it to a Nt machine? Thankx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: getting several files into a single array

2002-04-03 Thread Jonathan E. Paton
> I've tried using glob, but I can only get the file > _names_ into the array, not contents. I guess I could > just write three separate opens [i.e., open(FH1, > "file1.txt") and so on] and then put each into an > array, then push those onto @lines, but it seems like > there should be an easier wa

Re: how make a function not blocking...

2002-04-03 Thread Jonathan E. Paton
> Hi at all, Opps, I assume you meant "Hi et all", but that is latin for "Hi and all"... implying a name/group between "Hi" and "et"... such as: Hi humamiod lifeforms et all, Anyway, that's a little OT. > What is the best method for make a long time > function not blocking? Under Unix, you w

RE: getting several files into a single array

2002-04-03 Thread Nikola Janceski
thought about foreach? foreach my $file ("myfile.txt", "myfile2.txt"){ open(FH, $file); while(){ push @lines, $_ } close(FH); } > -Original Message- > From: patrick hall [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 03

Re: log file question

2002-04-03 Thread John W. Krahn
Lance Prais wrote: > > I am using the following code to parse through a log file and match words on > two sequential lines. I would like to add some code to it to check three > sequential lines. I have tried several things but with not luck. Could > someone please take a look at the code at let

getting several files into a single array

2002-04-03 Thread patrick hall
Hi, I've written a script with a run-of-the-mill open in it, like this: $file = "myfile.txt"; open(FH, $file); @lines = ; close(FH); Now I'd like to modify it to open several files, namely, ($myfile1, $myfile2, $myfile3) and store those into @lines. I've tried using glob, but I can only get t

how make a function not blocking...

2002-04-03 Thread Fabrizio Morbini
Hi at all, what is the best method for make a long time function not blocking? At this moment I solved the problem making the function a single executable perl file so I execute (in the main perl file) system(file-perl-for-function &); Thank you very much for any help. Fabrizio ---

Re: Matching question

2002-04-03 Thread Jenda Krynicky
From: "John W. Krahn" <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > "Elizabeth A. Rice" wrote: > > > > > > > > What I've written so far > > > > > > > > @ARGV = ("$logfile");# prime the diamond > > > > oper

Re: Matching question

2002-04-03 Thread John W. Krahn
Jenda Krynicky wrote: > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > "Elizabeth A. Rice" wrote: > > > > > > What I've written so far > > > > > > @ARGV = ("$logfile");# prime the diamond operator > > ^^^^ > > Useless use of quotation marks and parenthesis.

RE: perl executable

2002-04-03 Thread Timothy Johnson
Check out ActiveState's PerlApp or Perl2EXE. -Original Message- From: Mayank Ahuja To: PERL Sent: 4/3/02 12:27 AM Subject: perl executable Hi All We are using perl/tk to make an application. The application code spans on various files. Is there a way in which the whole code can be con

Re: Matching question

2002-04-03 Thread Jenda Krynicky
From: "John W. Krahn" <[EMAIL PROTECTED]> > "Elizabeth A. Rice" wrote: > > > > What I've written so far > > > > @ARGV = ("$logfile");# prime the diamond operator > ^^^^ > Useless use of quotation marks and parenthesis. > > @ARGV = $logfile; I agree complet

log file question

2002-04-03 Thread Lance Prais
I am using the following code to parse through a log file and match words on two sequential lines. I would like to add some code to it to check three sequential lines. I have tried several things but with not luck. Could someone please take a look at the code at let help me with this. Thank yo

  1   2   >