On Fri, 6 Jun 2003 21:22:13 +0100, Rob Dixon <[EMAIL PROTECTED]>
wrote:
Katy Brownfield wrote:
On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]>
wrote:
> John W. Krahn wrote:
> > Mark Anderson wrote:
> > >
> > > B) You should NEVER use map in a void context. map works very
hard
>
Hello all,
I was running a small test script with MIME::Fast and it simply
segfaults. Can anyone tell me why
## BEGIN SCRIPT ###
#!/usr/bin/perl
use MIME::Fast;
my $str = new MIME::Fast::Stream(\*DATA);
my $msg = MIME::Fast::Parser::construct_message($st
"Gupta, Sharad" wrote:
> While running this:
>
> my $new = "/newtests/new ";
> $new .= "\'$fields{public}\' \'$fields{sev}\' \'$fields{pri}\' ";
> $new .= "\'$fields{cc}\' \'$fields{bug_rel}\' \'$fields{type}\' ";
> $new .= "\'$fields{title}\' \'
Francis Henry wrote:
> Hi:
>
> The following is a note from a colleague of which I am skeptical:
>
> "fyi
> .pl used to be used for both executables and libraries.
> A library is simply perl code located in a different file which is
> imported into another perl program with the 're
Rob Dixon wrote:
> James Edward Gray II wrote:
> > On Friday, June 6, 2003, at 03:32 AM, R. Joseph Newton wrote:
> >
> > > The player's name IS the number. No other numbering system is
> > > needed. The players name is NEVER stored in the hash, AFAIK. The
> > > name is used to feed a hashing f
"John W. Krahn" wrote:
> ... just like there are some situations where goto is
> appropriate.
>
> :-)
>
> John
Careful John,
They don't make stake rope and kindling for nothing.
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Stuart White wrote:
> I've a problem that I think is best solved with
> multi-dimensional hashes. However, the reference that
> I'm using doesn't really cover them. Does anyone know
> where I might find some tutorial article of some sort
> with an example or two on multi-dimensional hashes?
>
>
Rob Dixon wrote:
> It's twenty or thirty years since we had to write programs carefully
> so that they would fit in 4KB of RAM and complete before the end of
> the day.
>
OGawd Rob,
Don't tell me you were around for that! I do remember my first computer
c. 1984, a closeout score of a Timex-Sinc
James Edward Gray II wrote:
> On Friday, June 6, 2003, at 03:32 AM, R. Joseph Newton wrote:
>
> > The player's name IS the number. No other numbering system is
> > needed. The players name is NEVER stored in the hash, AFAIK. The
> > name is used to feed a hashing function, which renders an ind
"R. Joseph Newton" wrote:
> Stuart White wrote:
>
> > This does make it clearer, but not entirely. Is this
> > what is happening: the loop starts, and goes
> > immediately into the if statement. when the regex
> > finds a line with "Jump Shot" it stores that in $2,
> > and the player name in $1.
Pedro Antonio Reche wrote:
>
> Hi All,
Hello,
> I would like to read and process line by line (using while) some text
> embeded into my perl script.
> I tried something like:
>
> #/usr/sbin/perl
>
> open(D, "__DATA__");
> while(){
There is nothing that you have to open. If you use the DATA f
You have to include the go_next; in your while loop.
Jair
- Original Message -
From: "Pedro Antonio Reche" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 06, 2003 3:40 PM
Subject: processing text in perl script
> Hi All,
>
> I would like to read and proces
Hi All,
I would like to read and process line by line (using while) some text
embeded into my perl script.
I tried something like:
#/usr/sbin/perl
open(D, "__DATA__");
while(){
print $_;
}
close(D);
__DATA__
This is a test
and nothing else
the execution of the prog
While running this:
my $new = "/newtests/new ";
$new .= "\'$fields{public}\' \'$fields{sev}\' \'$fields{pri}\' ";
$new .= "\'$fields{cc}\' \'$fields{bug_rel}\' \'$fields{type}\' ";
$new .= "\'$fields{title}\' \'$fields{description}\' \'$fields
James Edward Gray II wrote:
> On Friday, June 6, 2003, at 03:32 AM, R. Joseph Newton wrote:
>
> > The player's name IS the number. No other numbering system is
> > needed. The players name is NEVER stored in the hash, AFAIK. The
> > name is used to feed a hashing function, which renders an inde
Katy Brownfield wrote:
> On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]>
> wrote:
>
> > John W. Krahn wrote:
> > > Mark Anderson wrote:
> > > >
> > > > B) You should NEVER use map in a void context. map works very hard
> > > >to build up it's return value, so there should be a
On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]>
wrote:
John W. Krahn wrote:
Mark Anderson wrote:
>
> B) You should NEVER use map in a void context. map works very hard
>to build up it's return value, so there should be an assignment
>(=) operator to the left of your map
Rob Dixon <[EMAIL PROTECTED]> wrote:
> John W. Krahn wrote:
>>
>> splice() will only work with array not lists.
>
> ... but (as you meant to say, John) you can take a slice
> of a list like this
>
> my ($seconds, $minutes, $hours) = (localtime)[0..2];
And you can take the beginning of the list
The perl version of the server is 5.005_02.
And now it gives error message -
Can't locate Socket.pm in @INC (@INC contains: /opt/perl5/lib/5.00502/PA-RISC1..
-
Any ideas on this error?
"LoBue, Mark" wrote:
> > -Original Message-
> > From: anil adenan [mailto:[EMAIL PROTECTED]
> > Sent: S
Thanks all,
it is simple and works.
Jair
- Original Message -
From: "Mark G" <[EMAIL PROTECTED]>
To: "Jair Santos" <[EMAIL PROTECTED]>
Cc: "perl" <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 9:09 PM
Subject: Re: Is empty directory?
>> > Hi all,
> >
> > does anybody knows how to
John W. Krahn wrote:
> Mark Anderson wrote:
> >
> > B) You should NEVER use map in a void context. map works very hard
> >to build up it's return value, so there should be an assignment
> >(=) operator to the left of your map call almost always, otherwise
> >all of that work is wasted.
On Friday, June 6, 2003, at 11:27 AM, Francis Henry wrote:
Thanks Aman. I think I understand what he's trying to do - I'm more
concerned
that this is the common practice with perl and I wasn't aware of it.
Know what
I mean?
I've at least heard of it before, if that tells you anything. I
bel
Thanks Aman. I think I understand what he's trying to do - I'm more concerned
that this is the common practice with perl and I wasn't aware of it. Know what
I mean?
Aman Raheja wrote:
> What I think this note means to say it is to save the libraries ( small
> subroutines saved as .pl in a diffe
What I think this note means to say it is to save the libraries ( small
subroutines saved as .pl in a different file, you might write for your
program to make it look cleaner and by just doing require that .pl file you
may use the subroutine.)
All he's expecting to do is differentiate between the e
Sandip,
> $
> Contains the subpattern from the
> corresponding set of capturing parentheses from the
> last pattern match, not counting patterns matched in
> nested blocks that have been exited already.
> (Mnemonic:
> like \digits.) These variables are all read-only and
> dynamically
Hi all,
does anybody knows how to check if a diretory is empty?
TIA
Jair
i wanted to know what variables like $1, $2 mean and
so i was looking at the documentation for Perl
predefined variables in this following link :
http://www.perldoc.com/perl5.6/pod/perlvar.html
$
Contains the subpattern from the
corresponding set of capturing parentheses from the
l
Sorry guys... I found out I wasn't ending the while loop properly.. opps...
the good news is that i have it working now.. Thanks anyway..
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello.. I am having some problems with this sub... I am trying to take
some
> input box and send
Any programatic way to check either a script for dependent modules or as you
install something, then how to determine dependency if any?
Thanks.
Wags ;)
**
This message contains information that is confidential
and propri
Hi:
The following is a note from a colleague of which I am skeptical:
"fyi
.pl used to be used for both executables and libraries.
A library is simply perl code located in a different file which is
imported into another perl program with the 'require' keyword.
Now that we hav
[EMAIL PROTECTED] wrote:
> Through much digging I found AddScrollbars was defined in Tk::Frame..
>
> #!perl -w
> # Pchopler.pl
> use strict;
> use Tk 800.000;
> # These are all the modules that we are using in this script.
> use Tk::Frame;
> use Tk::TextUndo;
> use Tk::Text;
> use Tk::Scrollbar;
>
>Anthony Akens wrote:
>> Hi all,
>> I'm doing a text replace in a binary file, which works fine as long as the
>> text I replace it with is the exact same length. If the text I put in is longer or
>> shorter, the program that reads the file (not one I wrote) chokes and spews
>> out a bunch of ga
Anthony Akens wrote:
> Hi all,
> I'm doing a text replace in a binary file, which works fine as long as the
> text I replace it with is the exact same length. If the text I put in is longer or
> shorter, the program that reads the file (not one I wrote) chokes and spews
> out a bunch of garbage.
Charles K. Clarkson wrote:
> Bob Showalter <[EMAIL PROTECTED]>wrote:
>
> > Voodoo Raja wrote:
> > >
> > > there are more then enough to init manually.
> > >
> > > Is there any command I can use to kill any constants
> > > assigned.
> >
> > One trick is to have your script exec() itself.
>
>
Charles K. Clarkson wrote:
> Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> > sub nfiles {
> > opendir my $dh, $_[0] or die $!;
> > my @dir = readdir $dh;
> > return scalar @dir;
> > }
>
> That should be decremented by 2 to account for '.'
> and '..'. It could also get the count using
Bob Showalter <[EMAIL PROTECTED]>wrote:
: Voodoo Raja wrote:
: >
: > there are more then enough to init manually.
: >
: > Is there any command I can use to kill any constants
: > assigned.
:
: One trick is to have your script exec() itself.
What would this do? I didn't understand Voodoo's
Hamish Whittal wrote:
> Hi Everyone,
>
> I am needing to use some variables throughout all the modules that I
> have created. I was wondering, bar setting them at the top of each
> module, what the best means of doing this is. Perhaps setting an
> environment variable, but what other ideas. The ul
Rob Dixon <[EMAIL PROTECTED]> wrote:
: sub nfiles {
: opendir my $dh, $_[0] or die $!;
: my @dir = readdir $dh;
: return scalar @dir;
: }
That should be decremented by 2 to account for '.'
and '..'. It could also get the count using '()':
sub is_empty_dir {
return undef
On Friday, June 6, 2003, at 03:32 AM, R. Joseph Newton wrote:
The player's name IS the number. No other numbering system is
needed. The players name is NEVER stored in the hash, AFAIK. The
name is used to feed a hashing function, which renders an index into
the storage of the hash structure.
> "Stuart" == Stuart White <[EMAIL PROTECTED]> writes:
Stuart> I've a problem that I think is best solved with
Stuart> multi-dimensional hashes. However, the reference that
Stuart> I'm using doesn't really cover them. Does anyone know
Stuart> where I might find some tutorial article of some
You can create a "header" module and declare the variable there. Export
the variable from the header module. Wherever you use the header module,
you can access the variable has ::variable. This way
you can change the value of the variable in the header module and it
will change wherever it is acces
Hi Everyone,
I am needing to use some variables throughout all the modules that I
have created. I was wondering, bar setting them at the top of each
module, what the best means of doing this is. Perhaps setting an
environment variable, but what other ideas. The ultimate goal is to be
able to chang
I am installing html::mason.
I have activestate perl installed.
I have apache installed.
I have mod_perl installed.
I have download Mason and am trying to install the prerequisites and the
optional packages listed in the readme.
None of them where available from ppm.
So I have downloaded the sou
Hi all,
I'm doing a text replace in a binary file, which works fine as long as the
text I replace it with is the exact same length. If the text I put in is longer or
shorter, the program that reads the file (not one I wrote) chokes and spews
out a bunch of garbage. Is there a way in perl to deal
From: "John W. Krahn" <[EMAIL PROTECTED]>
> Mark Anderson wrote:
> >
> > B) You should NEVER use map in a void context. map works very hard
> >to build up it's return value, so there should be an assignment
> >(=) operator to the left of your map call almost always,
> >otherwise all o
Hello.. I am having some problems with this sub... I am trying to take some
input box and send it to a file on a remote system.. Well, that works ok,
but I would like to rename the file when I am done, because a process polls
for the file.. Anyhow, I think my code is not releasing the handle on the
Mark Anderson wrote:
>
> B) You should NEVER use map in a void context. map works very hard
>to build up it's return value, so there should be an assignment
>(=) operator to the left of your map call almost always, otherwise
>all of that work is wasted.
I would never say NEVER as the
Kevin Pfeiffer wrote:
>
> (Forgive the excitement)
>
> I just reversed the %n2m construct - the original builds a hash using map
> that lets you convert numbers to months, etc. (I probably found it here).
>
> In keeping with my feeling that with 'map' one can do almost anything (if I
> knew how)
John W. Krahn wrote:
> Bernhard Van Staveren wrote:
> >
> > There is an easier way (sorta) to get hours/minutes/seconds;
> >
> > ($seconds, $minutes, $hours)=splice(localtime(), 0, 3);
>
> Did you try this? No, I didn't think so. :-)
>
> splice() will only work with array not lists.
... but (as
Weird... I used it before on my server and it gave me the expected
results - unless someone did a custom job on localtime() or something I
wouldn't know why it did work at the time.
Either that or I'm really confused and I imagined this'd work ;)
(also an option)
On Thu, 5 Jun 2003, John W. Krah
In article <[EMAIL PROTECTED]>, Mark
Anderson wrote:
[...]
> "A guy with a hammer sees all his problems as nails." --Old software
> saying
[...]
But it's much easier to figure out what to do with a hammer than it is with
just a nail. ;-)
Thanks all for the lesson(s) and tips.
-K
--
Kevin P
On Thu, 5 Jun 2003, Saurabh Singhvi wrote:
> well if somebody can tell me how to use perl with my
> website. the main thing i want to use is password
> function. Any helps??
>
Do you know Perl at all?
If so, you can find a tutorial for CGI programming here:
http://perl-begin.berlios.de/cgi-bin/
Bernhard Van Staveren wrote:
>
> There is an easier way (sorta) to get hours/minutes/seconds;
>
> ($seconds, $minutes, $hours)=splice(localtime(), 0, 3);
Did you try this? No, I didn't think so. :-)
splice() will only work with array not lists.
John
--
use Perl;
program
fulfillment
--
To
Voodoo Raja wrote:
> Hi there
>
> I have got a script running..
>
> Its ment to repeat a particular sub routine using the "after" syntax
>
> All i want to do is clear everything in buffer ... since it eats up
> the memory
>
>
> I do not need any varaibles which I have defined in the sub.
If
Jenda Krynicky wrote:
> From: Kevin Pfeiffer <[EMAIL PROTECTED]>
> > In keeping with my feeling that with 'map' one can do almost
> > anything
>
> quite right, but
>
> > (if I knew how) I'm happy to have managed to build something using
> > 'map' (without external help I mean). Seems easy, now. ;-)
Try http://search.cpan.org
Search for CGI.pm
HTH
> -Original Message-
> From: Saurabh Singhvi [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2003 1:11 PM
> To: Perl FAq
> Subject: Documentation on Usin with...
>
>
> well if somebody can tell me how to use perl with my
> websi
try www.cpan.org
It's for all things Perl. ;-)
"Joel_divekar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All
>
> I am using Activestate Perl on win9x and wish to install crypt-blowfish
module. Activestate module repository does not have this module. Any advice.
>
> Regards
>
well if somebody can tell me how to use perl with my
website. the main thing i want to use is password
function. Any helps??
Regards
Saurabh
=
SAURABH SINGHVI
H-8,ROOM NO.291
IIT BOMBAY
POWAI
MUMBAI
___
> (Forgive the excitement)
Not a problem. Congratulations.
> I just reversed the %n2m construct - the original builds a hash using map
> that lets you convert numbers to months, etc. (I probably found it here).
>
> In keeping with my feeling that with 'map' one can do almost anything (if
I
> kne
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I must say that since joining this list I have had many days brightened by yet
another cool piece of code. The neat-o meter gets pegged almost everyday.
:-)
On Thursday 05 June 2003 12:49, Jenda Krynicky wrote:
> From: Kevin Pfeiffer <[EMAIL P
From: Kevin Pfeiffer <[EMAIL PROTECTED]>
> In keeping with my feeling that with 'map' one can do almost anything
quite right, but
> (if I knew how) I'm happy to have managed to build something using
> 'map' (without external help I mean). Seems easy, now. ;-)
>
> # months into numbers...
>
> $m
Hi All
I am using Activestate Perl on win9x and wish to install crypt-blowfish module.
Activestate module repository does not have this module. Any advice.
Regards
Joel
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy The Best In BOOKS at http://www.bestsellers
> (Forgive the excitement)
>
No problem!
> I just reversed the %n2m construct - the original builds a
> hash using map
> that lets you convert numbers to months, etc. (I probably
> found it here).
>
> In keeping with my feeling that with 'map' one can do almost
> anything (if I
> knew how)
(Forgive the excitement)
I just reversed the %n2m construct - the original builds a hash using map
that lets you convert numbers to months, etc. (I probably found it here).
In keeping with my feeling that with 'map' one can do almost anything (if I
knew how) I'm happy to have managed to build s
> thanks a lot frank..i think i hav got the thing.
>
> Regards
>
> Saurabh
There is an easier way (sorta) to get hours/minutes/seconds;
($seconds, $minutes, $hours)=splice(localtime(), 0, 3);
--
Bernhard van Staveren - madcat(at)ghostfield.com
GhostField Internet - http://www.gho
thanks a lot frank..i think i hav got the thing.
Regards
Saurabh
--- Frank Wiles <[EMAIL PROTECTED]> wrote:
> .--[ Saurabh Singhvi wrote (2003/06/05 at
> 07:57:14) ]--
> |
> | well i cant understand what the $1, $2 and $3
> do??
> | herez the code
> |
> | #!/usr/local/b
Jair Santos wrote:
> Hi all,
>
> does anybody knows how to check if a diretory is empty?
Does this suit what you want? It's got very inelegant error
handling but should suffice for most purposes.
use strict;
print nfiles('/usr/bin');
sub nfiles {
opendir my $dh, $_[0] or die $!;
m
You could 'delete' or 'undef' variables you don't want. But I sense that
you want a bigger wiper than that...
If you define variables using 'my' in the sub, Perl's gargbage collection
should annihilate them when it has time/needs resources. It might even
eliminate them as soon as you exit the sub
I finally install the Heap module. But I run the example of the CPAN:
foreach $i ( 1..100 )
{
$elem = NumElem($i);
$heap->add($elem);
}
It told me:
Can't locate auto/Heap/add.al in @INC
I search this directory but didn't find the add.al, is it caused by the
wrong installing o
Stuart White wrote:
> This does make it clearer, but not entirely. Is this
> what is happening: the loop starts, and goes
> immediately into the if statement. when the regex
> finds a line with "Jump Shot" it stores that in $2,
> and the player name in $1. The next thing it does,
> and I'm not
> well i cant understand what the $1, $2 and $3 do??
> herez the code
Howdy
> if ($date =~ /(\d\d):(\d\d):(\d\d)/)
^ ^ ^
$1 $2 $3
The $1,$2,$3 etc hold the parenthesis matched contents in a regex.
HTH
DMuey
--
To unsubscribe, e-mail: [E
.--[ Saurabh Singhvi wrote (2003/06/05 at 07:57:14) ]--
|
| well i cant understand what the $1, $2 and $3 do??
| herez the code
|
| #!/usr/local/bin/perl -w
|
| # Get the date in the standard date format. (ex: Tue
| Oct 24 19:03:03
| 1995 )
| my $date = localtime();
This would be more clear to you
($sec,$min,$hr,$day,$mon,$year)=localtime(time);
$year +=1900;
$mon=$mon+1;
Urmil
-Original Message-
From: Saurabh Singhvi [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:57 AM
To: Perl FAq
Subject: Cant seem to understand
well i cant understan
Stuart White wrote:
> Ok, I think I get it. the $_ is printing the player
> name, (though I don't know why I'm not using $1
$1 is a special-purpose variable used only in relation to regexes.
The default variable for looping structures will be contained in $_.
>
> instead for that) and the $line
well i cant understand what the $1, $2 and $3 do??
herez the code
#!/usr/local/bin/perl -w
# Get the date in the standard date format. (ex: Tue
Oct 24 19:03:03
1995 )
my $date = localtime();
# Search through the date looking for the hour,
minute, and second.
if ($date =~ /(\d\d):(\d\d):(\d\d)/)
perldoc perldsc
http://www.perldoc.com/perl5.8.0/pod/perldsc.html#HASHES-OF-HASHES
Perldoc perlreftut
http://www.perldoc.com/perl5.8.0/pod/perlreftut.html
HTH,
José.
> -Original Message-
> From: Stuart White [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2003 4:26 PM
> To: [EMAIL
In article <[EMAIL PROTECTED]>,
I wrote:
>If you were installing a binary, then try installing the source.
>You should be able to zip through by saying
>
> ./Configure -de -Uprefix=/usr
That should have course have been
./Configure -de -Dprefix=/usr
--
Peter Scott
http://www.perlde
On Thursday, June 5, 2003, at 09:26 AM, Stuart White wrote:
I've a problem that I think is best solved with
multi-dimensional hashes. However, the reference that
I'm using doesn't really cover them. Does anyone know
where I might find some tutorial article of some sort
with an example or two on
Stuart White wrote:
> Hey, thanks that worked!
>
> --- James Edward Gray II <[EMAIL PROTECTED]>
> wrote:
>
> > I don't seen any reason to use the array at all, so
> > I've removed it.
> > If you had one that I just didn't know about, send
> > it on back.
>
> That's how I tried to solve this piece
Stuart White wrote:
>
> Right now my array is just like that, minus the
> numbers. So what I want to do is assign the array to
> a hash. If I were to do that, my understanding is
> that the names would be keys and the numbers values,
> and doing such an assignment in a loop would cause
> some en
$data = "A Tab Separated DataFile";
@fields=split(/\t/,$data);
print "$fields[0] , $fields[1], $fields[2] , $fields[3] ";
Urmil
-Original Message-
From: Scott, Joshua [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 2:27 AM
To: beginners
Subject: Using defined ar
I've a problem that I think is best solved with
multi-dimensional hashes. However, the reference that
I'm using doesn't really cover them. Does anyone know
where I might find some tutorial article of some sort
with an example or two on multi-dimensional hashes?
I know that the syntax for referri
Jaschar Otto wrote:
> I'm always an very curious guy and i just because of that i made a little
> script that analyises my scripts, extracts the subs, counts lines,
> mys, uses, subs, etc... maybe some of you are as courious as i am
> but too lazy to do that for yourself, so i want to share it wit
83 matches
Mail list logo