I have an application that requires a configuration to be done before
some pages can be displayed. I have a hook in my code to divert to the
configuration if it hasn't occurred for the active session (I keep a
session ID). However, I'm having a hard time conceptualizing how to
store the
Dear Friends,
I have the below code.
my $a = :-:m:-:a:-:l:-:i:-:k; # Here each letter is separated by :-:
my $del = ':-:'; # Delimeter
my $b;
while ($a ne $b)
{
$a =~ /^$b$del(.?)($del)?/;
my $c = $1;
print $c\n;
$b .= $del . $c;
}
The above code is working fine. But when I
rmck [EMAIL PROTECTED] wrote:
Please stop top posting.
: I had to add a print $sum != to inside and outside the
: while loop. Im not sure why it is working this way?? Also
: Im getting an error Use of uninitialized value in string
: ne at ./clean1.pl line 28, LOG line 1. ??
Break it
On Mon, 2004-10-04 at 21:00, Graeme McLaren wrote:
Hey all .. I'm thinkin about writing a web application using perl
and object oriented techniques.
Nice try, a good point learning OOP in any language. Design issues are
not so easy to counsel.
I want to start off small ... lets
Here is the code:
my $r1 = [1,2];
my $r2 = [1,2];
How many anonymous arrays do we have now?
One or two?
This shows we have two arrays: print $r1\n$r2\n;
Is there any way to find out how the system is naming these arrays
internally?
thanks
adam
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
On Mon, 2004-10-04 at 17:57, JupiterHost.Net wrote:
When people undiscriminatingly advocate the use of modules whenever
possible, I get unhappy. I'm using modules when I consider it to be
suitable.
Peace my friend, do whatever you want.
It wasn't an attack, that's what the smiley's
I am expecting in both examples the same result:
Example1: the same references
Example2: the same references
However, I get:
Example1: different references
Example2: the same references
What am I missing?
thanks
adam
Here is the code:
#Example1
my $r1 = [1, 3];
my $r2 = [1, 3];
if ($r1 eq
Ramprasad A Padmanabhan said:
Hi,
I have slightly a tricky situation, in my large program. I am trying the
best to reproduce it
I have a string like this
$x='a{1}b{21}c{5}d';
# The numbers in the {} are random and are not of interest
I want to access all elements from the string 'a'
Mallik wrote:
Dear Friends,
Hello,
I have the below code.
my $a = :-:m:-:a:-:l:-:i:-:k; # Here each letter is separated by :-:
my $del = ':-:'; # Delimeter
my $b;
while ($a ne $b)
{
$a =~ /^$b$del(.?)($del)?/;
my $c = $1;
print $c\n;
$b .= $del . $c;
}
The above code is working
Adam wrote:
I am expecting in both examples the same result:
Example1: the same references
Example2: the same references
However, I get:
Example1: different references
Example2: the same references
What am I missing?
#Example1
my $r1 = [1, 3];
Store a reference to an anonymous array in a scalar.
From: Adam Saeed [EMAIL PROTECTED]
could any one tell me that SMTP::Net support attachment, if yes how it
could be to do so... thanks
I believe you meant Net:SMTP. No it doesn't. Net::SMTP does just the
low level SMTP stuff, no MIME, no multipart messages, no attachments.
* adam [EMAIL PROTECTED] [2004-10-04T22:32:50]
Here is the code:
my $r1 = [1,2];
my $r2 = [1,2];
How many anonymous arrays do we have now?
One or two?
This shows we have two arrays: print $r1\n$r2\n;
Two.
Is there any way to find out how the system is naming these arrays
internally?
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Chris Devers) writes:
Please use a more descriptive subject line.
On Mon, 4 Oct 2004, Bob Gordon wrote:
Anyone know how to remove a mirror from the list that CPAN uses? I
would like to remove ftp://carroll.cac.psu.edu from the list as it
Your use of (.?)($del)? does not do what you expect. In the case of
:-:a:-: you will find (.?) = 'a' and ($del)? matches a delimiter, BUT
:-::-:you will find (.?) = : and ($del)? matches nothing.
Check out 'look-ahead' matches for a way to solve this.
On Tue, 05 Oct 2004 04:03:21
Adam Saeed wrote:
could any one tell me that SMTP::Net support attachment, if yes how it
could be to do so...
Net::SMTP technically does but you'd have todo a lot of work. (IE like
how you'd do anattachemnt by SMTP vie CLI)
Try Jenda's excellent Mail::Sender module, it handles attachments very
On Mon, 2004-10-04 at 17:16, Chris Devers wrote:
On Mon, 4 Oct 2004, Tim Donahue wrote:
I'm looking for a module that will allow me to send/receive ascii data
to a serial port. I have a program that will allow me to query its
status over a serial connection, but I can't find a module on
Hi David,
Thanks for ur suggestion.
But I am a new-bie to Perl. Can u give me a example for 'look-ahead'
matches.
Regards,
Mallik.
-Original Message-
From: David le Blanc [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 5:57 PM
To: John W. Krahn
Cc: Perl Beginners
Subject: Re:
-Original Message-
From: Bakken, Luke [mailto:[EMAIL PROTECTED]
Sent: Monday, October 04, 2004 5:06 PM
To: West, William M; [EMAIL PROTECTED]
Subject: RE: speed of grep{s///} vs ??? or am i asking the wrong
question?
Try this, you don't need to shell out. It returns an array of
Gunnar == Gunnar Hjalmarsson [EMAIL PROTECTED] writes:
Gunnar I hear that you have never distributed CGI scripts to people who
Gunnar typically have never heard of CPAN and don't have shell access, and to
Gunnar whom Perl and CGI are synonyms. That's the 'business' I am in.
Then cut and paste
Gunnar == Gunnar Hjalmarsson [EMAIL PROTECTED] writes:
Gunnar Yeah, I noticed that, too. Randal should really think twice before
Gunnar including '' in his real addresses. :)
This is why I have to fight the continual battle. Too many websites
are borked.
--
Randal L. Schwartz - Stonehenge
-Original Message-
From: Randal L. Schwartz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 4:31 PM
To: [EMAIL PROTECTED]
Subject: Re: Email syntax validation
Silly person.
Oh oh! What's this ?
I can't imagine that's comes from Randal :-(
José.
DISCLAIMER
opendir LS, $directory or die Can't opendir $directory: $!;
my @dirs = grep { -d $_ } readdir LS;
closedir LS;
return @dirs;
thank you this is much more readable code too me- but i found out that
you need a fully qualified path...
Right, either that or chdir first before doing the
NYIMI == NYIMI Jose (BMB) [EMAIL PROTECTED] writes:
Silly person.
NYIMI Oh oh! What's this ?
NYIMI I can't imagine that's comes from Randal :-(
Why not? It's saying what I feel about that. I'm using silly
rather casually here. Maybe that's not coming through very well in
email. Imagine
Randal L. Schwartz wrote:
NYIMI == NYIMI Jose (BMB) [EMAIL PROTECTED] writes:
Silly person.
NYIMI Oh oh! What's this ?
NYIMI I can't imagine that's comes from Randal :-(
Why not? It's saying what I feel about that. I'm using silly
rather casually here. Maybe that's not coming through very
On Tue, 5 Oct 2004, Mallik wrote:
But I am a new-bie to Perl. Can u give me a example for 'look-ahead'
matches.
30 seconds on Google returned *lots* of documentation.
Here's some of it:
http://www.perldoc.com/perl5.8.4/pod/perlre.html
http://www.perl.com/pub/a/2001/05/01/expressions.html
--- Charles K. Clarkson [EMAIL PROTECTED]
wrote:
[snip]
my $prev_date;
if ( $prev_date ne 'foo' ) {## LINE 28 ##
print 'foo';
}
Since prev_date does not have value, it cannot
be compared
without raising a warning. On the second pass
$prev_date has
a value.
Isn't
my $prev_date;
if ( $prev_date ne 'foo' ) {## LINE 28 ##
print 'foo';
}
Since prev_date does not have value, it cannot
be compared
without raising a warning. On the second pass
$prev_date has
a value.
Isn't $prev_date assigned to '', and isn't that
It is if you do
my $prev_date = '';
I have created a module, and inside one of the Package methods, I have
the following code:
$href = $getPlanInfo-fetchrow_hashref();
foreach my $key (keys %$href) {
print $key : $href-{$key}\n;
$name = $key;
$self-{$name} = $href-{$key};
Steve
You may want to think of this from a DB perspective.
Is there a unique key associated with each of these lookups that could prevent
duplicate rows being returned? If you are looking up info for a particular person, I
would assume you would only want 1 returned and you would want a key
Steve
You may want to think of this from a DB perspective.
Is there a unique key associated with each of these lookups that could
prevent duplicate rows being returned? If you are looking up info for
a particular person, I would assume you would only want 1 returned and
you would want a
Please bottom post
Steve
You may want to think of this from a DB perspective.
Is there a unique key associated with each of these lookups that could
prevent duplicate rows being returned? If you are looking up info for a
particular person, I would assume you would only want 1 returned
I have created a module, and inside one of the Package methods, I
have
the following code:
$href = $getPlanInfo-fetchrow_hashref();
foreach my $key (keys %$href) {
print $key : $href-{$key}\n;
$name = $key;
$self-{$name} =
--- JupiterHost.Net [EMAIL PROTECTED] wrote:
Isn't $prev_date assigned to '', and isn't that
It is if you do
my $prev_date = '';
but
my $prev_date;
it is uninitialized as in it hasn't been assigned
any value incuding
empty
Compare
perl -mstrict -we 'my $v;for(1..3) { print
Hi,
Is there a method to pass a shell assigned variable to perl?
For ex:
ABC=xyc
perl -ne 'print $ABC'
In awk you could use ENVIRON[varname], is there something
compatible in perl.
Willy Perez
Liz Claiborne IT
(201) 295-7011
$ENV{ABC}
This works for me, but I don't have a good understanding of what is
going on to make it work.
HTH,
David
On Tue, 5 Oct 2004 14:32:27 -0400, Willy Perez [EMAIL PROTECTED] wrote:
Hi,
Is there a method to pass a shell assigned variable to perl?
For ex:
ABC=xyc
perl -ne
Hi,
Is there a method to pass a shell assigned variable to perl?
For ex:
ABC=xyc
perl -ne 'print $ABC'
In awk you could use ENVIRON[varname], is there something
compatible in perl.
You can do the same in perl with the special hash named %ENV.
for instance: print
On Tue, 5 Oct 2004 14:32:27 -0400, Willy Perez [EMAIL PROTECTED] wrote:
Hi,
Is there a method to pass a shell assigned variable to perl?
For ex:
ABC=xyc
perl -ne 'print $ABC'
In awk you could use ENVIRON[varname], is there something
compatible in perl.
Willy Perez
Liz
I have created a module, and inside one of the Package methods, I
have
the following code:
$href = $getPlanInfo-fetchrow_hashref();
foreach my $key (keys %$href) {
print $key : $href-{$key}\n;
$name = $key;
Thanks Errin/Jim/David,
Hi Willy,
Perl will auto-magically take all of your shell environment variables and
put them in a hash:
%ENV
where the keys are the variable names and the values are the values!
so, for your example above,
# perl -e 'print $ENV{ABC}\n'
should work!
--Errin
You can
Compare
perl -mstrict -we 'my $v;for(1..3) { print
$v\n;$v++; }'
with
perl -mstrict -we 'my $v = ;for(1..3) { print
$v\n;$v++; }'
Hmm, I could swear I read in my manual that perl will
automatically initialize variables. But, that's
obviously not case, as your example demonstrates.
Thanks for
James Taylor wrote:
I posted this to the mod_perl list 2 days ago, but it seems a bit
inappropriate there as the discussion is much more
advanced than my question... That and I haven't gotten a response, so
sorry for the crosspost :)
I'm running apache 1.3.x with the associated version of
Randal L. Schwartz wrote:
Gunnar Hjalmarsson writes:
I hear that you have never distributed CGI scripts to people who
typically have never heard of CPAN and don't have shell access,
and to whom Perl and CGI are synonyms. That's the 'business' I am
in.
Then cut and paste the relevant parts of
I beleive you're taking everyone's good advice as a personal attack.
Everyone is trying to help you avoid pitfall's you're likley to come
accross based on experience, lots of it.
Everyone is trying to help you. Do whatever you want, but if you don't
want answers don't ask for free help :)
Bob Showalter wrote:
FWIW, That example works OK for me under Apache 1.3.31, mod_perl 1.29 when I
run under Apache::Registry. I had to add a declaration for %somehash, but
otherwise it runs without error. Is main.pl running under Apache::Registry,
or is it a PerlHandler or some other type of
[Please do not top-post. TIA]
David le Blanc wrote:
On Tue, 05 Oct 2004 04:03:21 -0700, John W. Krahn [EMAIL PROTECTED] wrote:
Mallik wrote:
I have the below code.
my $a = :-:m:-:a:-:l:-:i:-:k; # Here each letter is separated by :-:
my $del = ':-:'; # Delimeter
my $b;
while ($a ne $b)
{
$a =~
Hi all,
I have a flatfile database (falldata.tmp) that contains information about
all the courses offered
this includes: course number, course title, start date, day of week,
location, html link, section number, fee1, fee2, and status.
I have another file (cancel.txt) which contains a list of
Fist of all thank you both very much, this has been a good learning experience.
[snip]
From: RichT mailto:[EMAIL PROTECTED] wrote:
: im still very new to perl
: what is does in searches through a large data file finds the
: segments i need and outputs the data in a more
Jim wrote:
Willy Perez wrote:
Is there a method to pass a shell assigned variable to perl?
For ex:
ABC=xyc
perl -ne 'print $ABC'
In awk you could use ENVIRON[varname], is there something
compatible in perl.
You can do the same in perl with the special hash named %ENV.
for instance: print
JupiterHost.Net wrote:
I beleive you're taking everyone's good advice as a personal
attack.
Now you are using that word attack again, and I can asure you that
I'm not.
Everyone is trying to help you. Do whatever you want, but if you
don't want answers don't ask for free help :)
Well, my initial
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 06, 2004 4:32 AM
Subject: newbie stuck in a HOA
Hi all,
I have a flatfile database (falldata.tmp) that contains information about
all the courses offered
this includes: course number,
Try this and hope this would help more *Code not tested*
Suppose data in cancel.txt :
123456|X
234567|X
Suppose data in falldata.tmp :
028076|Blood|Sept 18|Sat|San Francisco|028086.html|1|275|0||
123456|Quake|Sept 19|Sun|Home|028087.html|1|275|0||
234567|Doom|Sept 20|Mon|Page
Hello everyone,
I'm parsing a Logwatch report I get daily from my server and have hit
a snag. I'd like to grab everything between the pam_unix Begin line
and the pam_unix End line.
- pam_unix Begin
sshd:
Invalid Users:
Unknown Account: 17
On 10/5/2004 10:25 PM, Kevin Old wrote:
Hello everyone,
I'm parsing a Logwatch report I get daily from my server and have hit
a snag. I'd like to grab everything between the pam_unix Begin line
and the pam_unix End line.
- pam_unix Begin
sshd:
On Tue, 05 Oct 2004 22:36:45 -0400, Randy W. Sims
[EMAIL PROTECTED] wrote:
On 10/5/2004 10:25 PM, Kevin Old wrote:
Hello everyone,
I'm parsing a Logwatch report I get daily from my server and have hit
a snag. I'd like to grab everything between the pam_unix Begin line
and the pam_unix
On 10/5/2004 10:36 PM, Randy W. Sims wrote:
while (defined( my $line = INPUT )) {
if ( /-+ pam_unix Begin -+/ .. /-+ pam_unix End -+/ ) {
# between beginning and end
}
}
err, that was obviously not tested. Should be:
while (defined( my $line = DATA )) {
if ( $line =~ /begin/ ..
On Tue, 05 Oct 2004 22:46:58 -0400, Randy W. Sims
[EMAIL PROTECTED] wrote:
On 10/5/2004 10:36 PM, Randy W. Sims wrote:
while (defined( my $line = INPUT )) {
if ( /-+ pam_unix Begin -+/ .. /-+ pam_unix End -+/ ) {
# between beginning and end
}
}
err, that was
56 matches
Mail list logo