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
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
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
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.
> 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/
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
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
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
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
> -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
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
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
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
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
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 (<
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
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
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
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 ".."
[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
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
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
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
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
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
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
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
>
> 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
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)
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
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
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
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
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
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]
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_
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
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
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
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
>
>
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
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
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
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
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
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
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
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
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
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
-
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
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,
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
53 matches
Mail list logo