Re: subroutine in seperate file, question

2012-08-11 Thread Rob Dixon
On 11/08/2012 12:43, Shawn H Corey wrote: No, @ISA is used only by Exporter.pm Exporter makes no use of @ISA at all. This array is a per-package variable used by Perl internally to implement object-oriented inheritance. It is very often used to make a package a subclass of Exporter, but that i

Re: subroutine in seperate file, question

2012-08-11 Thread Rajeev Prasad
August 11, 2012 6:43 AM Subject: Re: subroutine in seperate file, question On Sat, 11 Aug 2012 02:49:56 -0400 shawn wilson wrote: > On Aug 10, 2012 11:41 PM, wrote: > > > > > I mean to ask, wether they will clash with the same loaded modules > loaded > > > in ca

Re: subroutine in seperate file, question

2012-08-11 Thread Shawn H Corey
On Sat, 11 Aug 2012 02:49:56 -0400 shawn wilson wrote: > On Aug 10, 2012 11:41 PM, wrote: > > > > > I mean to ask, wether they will clash with the same loaded modules > loaded > > > in calling script? > > > > > > > No. they are loaded only once. > > > > Well, they will both be in ISA to look up

Re: subroutine in seperate file, question

2012-08-10 Thread shawn wilson
On Aug 10, 2012 11:41 PM, wrote: > > > I mean to ask, wether they will clash with the same loaded modules loaded > > in calling script? > > > > No. they are loaded only once. > Well, they will both be in ISA to look up separately but there is no conflict.

Re: subroutine in seperate file, question

2012-08-10 Thread pangj
> I mean to ask, wether they will clash with the same loaded modules loaded > in calling script? > No. they are loaded only once. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: subroutine in seperate file, question

2012-08-10 Thread Rajeev Prasad
I mean to ask, wether they will clash with the same loaded modules loaded in calling script? From: "pa...@riseup.net" To: Rajeev Prasad Cc: perl list Sent: Friday, August 10, 2012 9:05 PM Subject: Re: subroutine in seperate file, question Yes, t

Re: subroutine in seperate file, question

2012-08-10 Thread pangj
Yes, the modules in required file will be loaded. $ cat ext.pl use CGI; use DBI; 1; $ cat main.pl require 'ext.pl'; use Data::Dumper; print Dumper \%INC; Thus run perl main.pl to see what prints. > i want to keep a peice of code which uses CGI and DBIx module in a > seperate file, and want t

subroutine in seperate file, question

2012-08-10 Thread Rajeev Prasad
i want to keep a peice of code which uses CGI and DBIx module in a seperate file, and want to include it in all my scripts as follows:   require "/path/to/script/file";   I am not sure if the calling program is also using same modules CGI and DBIx what kind of unknown errors i might get? anyone k

Re: Lock file question

2011-06-22 Thread John W. Krahn
Steven Buehler wrote: From: Jim Gibson [mailto:jimsgib...@gmail.com] On 6/22/11 Wed Jun 22, 2011 3:02 PM, "Steven Buehler" scribbled: I am trying to use a lockfile so that the script can't be run again if it is already running. The below code works fine. The problem is that if my script

RE: Lock file question

2011-06-22 Thread Steven Buehler
> -Original Message- > From: Jim Gibson [mailto:jimsgib...@gmail.com] > Sent: Wednesday, June 22, 2011 5:35 PM > To: beginners@perl.org > Subject: Re: Lock file question > > On 6/22/11 Wed Jun 22, 2011 3:02 PM, "Steven Buehler" > > scribbled: &g

Re: Lock file question

2011-06-22 Thread Jim Gibson
On 6/22/11 Wed Jun 22, 2011 3:02 PM, "Steven Buehler" scribbled: > I am trying to use a lockfile so that the script can't be run again if it is > already running. The below code works fine. The problem is that if my > script runs with an argument for a config file with one person trying to ru

Lock file question

2011-06-22 Thread Steven Buehler
I am trying to use a lockfile so that the script can't be run again if it is already running. The below code works fine. The problem is that if my script runs with an argument for a config file with one person trying to run it as "script.pl first.cfg" and the second person trys to run it as "scri

Re: csv file question

2008-05-09 Thread perl pra
Hi please check the following script , you need not to handle null because it is in quotes,I have tested the following code it works fine use strict; use warnings; my %has; my $NULL=0; (open my $FH, '<', "mail.csv") or die "$!"; while(<$FH>) { my($one,$two,$three)=split(/\,/,$_); $has{$one

Re: csv file question

2008-05-06 Thread Gunnar Hjalmarsson
Anirban Adhikary wrote: I have a csv file having the following contents. col1 col2 col3 "A", "1","2" "B","1", "3" "C","2","4" "D","1","5" "A","1","6" "B","2","7" "C","2","8" " ","3","9" Now I want to implement a logic which will show me the summarize records as follows col1 count A- 2 B - 2

Re: csv file question

2008-05-06 Thread yitzle
I'm sure someone more experienced will have a far more elegant solution, but something along these lines might work. (Note: code untested) %count; while (<>) { if ($_ =~ /^"([^"]*)"/) { %count{$1}++; } } for (keys %count) { print "$_ - $count{$_}\n"; } or, refractored, %count; while (<

csv file question

2008-05-06 Thread Anirban Adhikary
Dear list I have a csv file having the following contents. col1 col2 col3 "A", "1","2" "B","1", "3" "C","2","4" "D","1","5" "A","1","6" "B","2","7" "C","2","8" " ","3","9" Now I want to implement a logic which will show me the summarize records as follows col1 count A- 2 B - 2 C - 2 D - 1

Re: Newbie File Question....

2008-02-13 Thread David Moreno
On Feb 13, 2008 12:30 PM, <[EMAIL PROTECTED]> wrote: > Thank you to all who replied to this requestnow I > understand! I appreciate the help and the courtesy > of the replies! Once againThank You!! "One more satisfied customer" -said somewhere sometime by merlyn. -- David Moreno - http

RE: Newbie File Question....

2008-02-13 Thread Richard.Copits
Thank you to all who replied to this requestnow I understand! I appreciate the help and the courtesy of the replies! Once againThank You!! -Original Message- From: Copits Dick Sent: Wednesday, February 13, 2008 11:35 AM To: beginners@perl.org Subject: Newbie File Question

Re: Newbie File Question....

2008-02-13 Thread MK
On 02/13/2008 11:34:56 AM, [EMAIL PROTECTED] wrote: -> I've been going over some listings and I found code -> -> like the following: -> -> -> -> "./directory/file.txt" and -> -> "../directory/file.txt" this is not really a perl question, but since perl does respect the reference: "." and ".."

Re: Newbie File Question....

2008-02-13 Thread Michael Barnes
[EMAIL PROTECTED] told me on 02/13/2008 10:34 AM: > I've been going over some listings and I found code > > like the following: > > > > "./directory/file.txt" and > > "../directory/file.txt" > > > > but I've never seen the "./" and "../" things at the > > beginning of the path. I've trie

Re: Newbie File Question....

2008-02-13 Thread Kashif Salman
On Feb 13, 2008 8:34 AM, <[EMAIL PROTECTED]> wrote: > I've been going over some listings and I found code > > like the following: > > > > "./directory/file.txt" and > > "../directory/file.txt" > > > > but I've never seen the "./" and "../" things at the > > beginning of the path. I've tried to goo

Re: Newbie File Question....

2008-02-13 Thread Rob Coops
On a unix/linux file system you see the following: $ ls -la total 244 drwx--9 rcoops ddao24096 Feb 13 09:40 . drwxr-xr-x 39 root root 4096 Feb 11 13:23 .. -rw---1 rcoops ddao2 158310 Feb 13 09:40 .bash_history -rw-r--r--1 rcoops ddao2 2

Newbie File Question....

2008-02-13 Thread Richard.Copits
I've been going over some listings and I found code like the following: "./directory/file.txt" and "../directory/file.txt" but I've never seen the "./" and "../" things at the beginning of the path. I've tried to google these but had no luck. I've googled "file specification" and "dire

Re: MIME coding & flags for sending a .csv or Excel file (Question)

2004-07-14 Thread John W . Krahn
On Tuesday 13 July 2004 07:20, jason corbett wrote: > > Thanks John. This was my first PERL program that I wrote and I wasn't > sure when to use the my vs the our, but your points are well > respected. I need more practice to understand how the > functions/script work so that I can condense the pro

Re: MIME coding & flags for sending a .csv or Excel file (Question)

2004-07-13 Thread jason corbett
Thanks John. This was my first PERL program that I wrote and I wasn't sure when to use the my vs the our, but your points are well respected. I need more practice to understand how the functions/script work so that I can condense the programming better. Question: Is the scalar function always

Re: File question

2004-03-08 Thread Robin Sheat
On Mon, Mar 08, 2004 at 09:53:26PM -0500, Luinrandir Hernsen wrote: > Do I keep one big file with all the info.. > of several little files.. > which is better? I assume you are referring to perl CGI or something are you? If so, I'd suggest looking into using a database and designing an appropriate

File question

2004-03-08 Thread Luinrandir Hernsen
I want to write an online game... I need a to make a logon page and a new person page. I think I can do this with little help... however on the map... Do I keep one big file with all the info.. of several little files.. which is better? Thanks Lou -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

RE: File question

2002-11-20 Thread Kipp, James
> > Hi everyone, > >Is there a way to open a file in a folder/s above/below > the one the > script is in? (OS is win2k), > > Thanks, > Chris. sorry to be brief but pressed for time. Try using the Cwd module. this way it is easy to tell where you are, therefore easier to cd to par

Re: File question

2002-11-20 Thread Han Fleet
Hi, if you have a file called index.txt in the folder the cgi-bin is in, you can use the following code. open (TFILEX,"../index.txt") || &error2; Use ../ to go backward in the pathway. Han. Is there a way to open a file in a folder/s above/below the one the script is in? (OS is win2k)

RE: File question

2002-11-20 Thread Timothy Johnson
e "Couldn't open file! $!"; open(ONEDIRUP,"./anotherdir/afile.csv") || die "Couldn't open afile.csv! $!"; -Original Message----- From: Chris Zampese [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 11:23 AM To: [EMAIL PROTECTED] Subject: File ques

File question

2002-11-20 Thread Chris Zampese
Hi everyone, Is there a way to open a file in a folder/s above/below the one the script is in? (OS is win2k), Thanks, Chris. _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=featur

Re: Open/Writing To A File Question

2002-10-08 Thread Jenda Krynicky
From: "Anthony Beaman" <[EMAIL PROTECTED]> > Hi! I'm sure this is simple and I'm overlooking something but here > goes. I'm trying to write a script that will ping a machine but print > it's results to a file (in Wordpad; I'm using NT) and the file will > open and show the results. I'm able to pi

Open/Writing To A File Question

2002-10-08 Thread Anthony Beaman
Hi! I'm sure this is simple and I'm overlooking something but here goes. I'm trying to write a script that will ping a machine but print it's results to a file (in Wordpad; I'm using NT) and the file will open and show the results. I'm able to ping and I'm able to direct it to a file but it's n

Re: URL file question

2002-04-10 Thread Felix Geerinckx
on Wed, 10 Apr 2002 19:33:43 GMT, Wade Olson wrote: > What is the best way to read the contents of a file out the Internet? > > Example: get the text from http://mycompany.com/index.html and put into use LWP::Simple; $text = get($url); -- felix -- To unsubscribe, e-mail: [EM

URL file question

2002-04-10 Thread Olson, Wade
Hi, What is the best way to read the contents of a file out the Internet? Example: get the text from http://mycompany.com/index.html and put into string, array, redirect, etc? TIA! Wade -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

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_

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

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

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

Re: open(FILE, " ") question

2002-03-20 Thread Jenda Krynicky
From: "Eric Preece" <[EMAIL PROTECTED]> > I am very new to perl. I am writing a script that is supposed to open > an html file and do some various tasks then later on it should print > out the html file. I am having problems with one portion of it. I > distilled it down to this code snippet > >

Re: open(FILE, " ") question

2002-03-20 Thread Agustin Rivera
Wednesday, March 20, 2002 1:52 PM Subject: open(FILE, " ") question Hi, I am very new to perl. I am writing a script that is supposed to open an html file and do some various tasks then later on it should print out the html file. I am having problems with one portion of it. I d

open(FILE, " ") question

2002-03-20 Thread Eric Preece
Hi, I am very new to perl. I am writing a script that is supposed to open an html file and do some various tasks then later on it should print out the html file. I am having problems with one portion of it. I distilled it down to this code snippet == # t

Re: file question

2002-02-10 Thread Jenda Krynicky
From: "Chris Zampese" <[EMAIL PROTECTED]> > Hi everyone, > I thought that the folowing code should save the data to the > file, and then when it was run again it should save the new data > on a newline in the same file. It saved the data once, but it > will n

RE: file question

2002-02-08 Thread Wagner-David
PROTECTED] Subject: file question Hi everyone, I thought that the folowing code should save the data to the file, and then when it was run again it should save the new data on a newline in the same file. It saved the data once, but it will not repeat the feat. The data comes from a form, and I

file question

2002-02-08 Thread Chris Zampese
Hi everyone, I thought that the folowing code should save the data to the file, and then when it was run again it should save the new data on a newline in the same file. It saved the data once, but it will not repeat the feat. The data comes from a form, and I use it to generate an email

Re: simple file question

2002-01-30 Thread Roger C Haslock
An alternative might be a tied hash, where the key is the email address. - Roger - - Original Message - From: "Chris Zampese" <[EMAIL PROTECTED]> To: "perl list" <[EMAIL PROTECTED]> Sent: Wednesday, January 30, 2002 2:10 AM Subject: simple file questi

Re: simple file question

2002-01-29 Thread Deen Hameed
while ( ) { push(@new_names, $_) unless ($_ eq $myvar); } # now you have a list of new names you can append to the file open(FILEHANDLE, ">>somefile.txt"); print FILEHANDLE join("\n", @new_names); close FILEHANDLE; deen On Wed, 30 Jan 2002, Chris Zampese wrote: > Hello eve

Re: simple file question

2002-01-29 Thread Tanton Gibbs
BTW, I forgot a chomp... while( ) { chomp; ... same as before... } - Original Message - From: "Tanton Gibbs" <[EMAIL PROTECTED]> To: "Chris Zampese" <[EMAIL PROTECTED]>; "perl list" <[EMAIL PROTECTED]> Sent: Tuesday, January 29

Re: simple file question

2002-01-29 Thread John W. Krahn
Chris Zampese wrote: > > Hello everyone, Hello, >I have a variable $myvar (an email address), and > I would like to open a simple text file which contains > email addresses (one on each line) and check to see if > the address in $myvar is in there, if it is not, then > append it o the end o

RE: simple file question

2002-01-29 Thread McDonald Patrick
Write your print statement like this if /$email2/o { print FILE2; } -Original Message- From: Chris Zampese [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 9:18 PM To: perl list Subject: Re: simple file question Just found a regex in the docs. I now have this... while

Re: simple file question

2002-01-29 Thread Tanton Gibbs
- From: "Chris Zampese" <[EMAIL PROTECTED]> To: "perl list" <[EMAIL PROTECTED]> Sent: Tuesday, January 29, 2002 9:10 PM Subject: simple file question Hello everyone, I have a variable $myvar (an email address), and I would like to open a simple text file which contains

Re: simple file question

2002-01-29 Thread Chris Zampese
t: Wednesday, January 30, 2002 3:10 PM Subject: simple file question Hello everyone, I have a variable $myvar (an email address), and I would like to open a simple text file which contains email addresses (one on each line) and check to see if the address in $myvar is in there, if it is not,

simple file question

2002-01-29 Thread Chris Zampese
Hello everyone, I have a variable $myvar (an email address), and I would like to open a simple text file which contains email addresses (one on each line) and check to see if the address in $myvar is in there, if it is not, then append it o the end of the file, and if it is, then close the f