"Dillon, John" wrote:
> When I am in a black command.com screen with CPAN> prompt, where am I? Why
> can't I cd to c:\?
>
> John
You are in a CPAN shell, which you asked for in the command
perl use_module(CPAN) execute(SHELL)
or *something like that* :-) that you typed into the command line.
Jo
"Dillon, John" wrote:
> Is there a gobble-di-gook looker-upper for perl. For instance, if I don't
> know what '@_' is saying, as in:
>
> my($email, $orig_email) = @_;
You should read a Perl reference if you are going to use Perl.
perldoc perlvar
Joseph
--
To unsubscribe, e-mail: [EMAIL PROT
Ville Jungman wrote:
> Shortly, I think it might be good if loops (etc.) could return values.
>
> Example 1: Retnext (like 'return next' borrowed from pl/sql)
> You want to extract numbers from an array if they are > 4 and put an
> 'a'-letter after them.
use strict;
use warnings;
>
>
>@value
Dan Anderson wrote:
> Is there an easy way to read into a stack until some pattern is
> matched and then break. I tried all sorts of (error producing) code,
> but nothing seemed to work. I ended up with:
>
> #! /usr/bin/perl
>
> #can I make this more concise?
use strict;
use warnings;
# and te
"NIPP, SCOTT V (SBCSI)" wrote:
> I posted the other day a question about writing a daemon to monitor
> a directory and then process the files as they arrive in said directory. I
> will begin working on this shortly, but I have a related question and this I
> think is mainly a question of
Hoenie Luk wrote:
> Has anyone try to delay loading the Statistics module by using autouse? I
> can't get it to work.
So what does this have to do with "env vars using perl"?
Please just give the address of this mailing list in your address book and send a
fresh message. Reply features should
From: "Hanson, Rob" <[EMAIL PROTECTED]>
If you really want a loop to return something, you can roll your own, even
in Perl 5... but the syntax won't be as you gave.
Ye - i'm not searching a way to solve a single problem but trying to make
programming easier. If loops returned values it would make
On Thu, Sep 25, 2003 at 05:15:56PM +0300, Juris wrote:
> On Thu, 25 Sep 2003 12:10:15 +0530, Chetak Sasalu M
> <[EMAIL PROTECTED]> wrote:
>
> >
> >Hi,
> >How can I extract "filename" from /root/dir1/.../filename
> $path_name='/root/dir1/.../filename';
> my $fname=substr($path,
> rindex($path,"/
On Thu, Sep 25, 2003 at 09:12:48PM -0400, Dan Anderson wrote:
> If I create code with:
>
> BEGIN
> {
># something
>BEGIN
>{
> # something else
>}
> }
>
> Will the inner BEGIN block take precedence over the outer one, and thus
> load any subroutines or whatever is in the inner
Ville Jungman wrote:
Shortly, I think it might be good if loops (etc.) could return values.
Yes, You're right John! A very good example! Which one would be more
readable?
This:
@bigger_than_4=
foreach $value(@values) {
retnext $value."a" if $value > 4;
}
;
...or this:
@
> Rob, did You read my message at all :-) ?
I'm not telling. :P
If you really want a loop to return something, you can roll your own, even
in Perl 5... but the syntax won't be as you gave.
How is this? The only difference is that you need to put the array to loop
over after the code. it's clos
What is really driving me bonkers is if I try the following code:
use strict;
use warnings;
END
{
print "Look ma, i'm using subroutines!";
foo::foo();
}
BEGIN
{
print "\nouter\n";
BEGIN
{ print "\ninner\n"; }
}
print "end\n";
BEGIN
{
package foo;
foo();
BEGIN
Thanks, sounds much more exciting now. Perhaps I should read what they mean
for those constructs but sounds very promising.
ville jungman, 2 laureston crescent, tower, blarney, cork, ireland
tel. + 353 - 21 - 451 6847, http://www.kolumbus.fi/vilmak
usko Herraan Jeesukseen, niin sinä pelastut. (ap
Ville Jungman wrote:
>
> Shortly, I think it might be good if loops (etc.) could return values.
>
> Example 1: Retnext (like 'return next' borrowed from pl/sql)
> You want to extract numbers from an array if they are > 4 and put an
> 'a'-letter after them.
>
>@values=(1,3,5,7);
>@bigger_
Rob, did You read my message at all :-) ?
i just was wandering if there _could_ be more readable way to do this.
Andnot only for to be readable. If loops (and maybe some other builtin
commands, too - we are not talking only about whiles and for's) returned
values, programming might be a way dif
> Will the inner BEGIN block take precedence over the outer one
I dunno, but I guess I could check...
print "Done\n";
BEGIN {
print "Top begin\n";
}
BEGIN {
print "Outer\n";
BEGIN {
print "Inner\n";
}
}
BEGIN {
print "Bottom begin\n";
}
This prints:
Top begin
Inner
Outer
Bottom be
Dan Anderson wrote:
>
> Is there an easy way to read into a stack until some pattern is
> matched and then break. I tried all sorts of (error producing) code,
> but nothing seemed to work. I ended up with:
>
> #! /usr/bin/perl
>
> #can I make this more concise?
> $infinite_loop = 1;
> while (
If I create code with:
BEGIN
{
# something
BEGIN
{
# something else
}
}
Will the inner BEGIN block take precedence over the outer one, and thus
load any subroutines or whatever is in the inner begin block? Or will
the second begin block be ignored and the compiler see:
BEGIN
{
> Shortly, I think it might be good if
> loops (etc.) could return values.
BTW - One of the goals for Perl 6 is that you will be able to build any Perl
construct in Perl itself.
So also although Perl5, and probably Perl6, won't let you return values from
a loop, you should at least be able to bui
--On Thursday, September 25, 2003 20:40 -0400 Dan Anderson
<[EMAIL PROTECTED]> wrote:
First, thank you for your help. Second, please bear with me as
I'm a perl noob.
I assume that $_ is the last thing gotten by .
Nope. ;-) $_, in the context listed in his example, is the value of
the
> On Tue, Sep 23, 2003 at 12:04:05PM -0500, Robert Greenway wrote:
> > have opened 3 additional toplevel windows in my application for input of
> > optional parameters. How can I query if they exist, so I don't recreate
> them
> > and so I can process them when completed?
> >
On Wed, Sep 24, 2003
> I assume that $_ is the last thing gotten by
Yes, but there is a little more to it than that.
Normally while() does NOT set $_. So this would not work normally:
while ($foo) { print $_ } # $_ is NOT set
At some point it was decided that most people will use a while loop to loop
over the lin
Raghupathy wrote:
> Dear Friends,
>
>I have perl 5.6.0 for windoze and ppm 2.1.2. I like
> to install Tie::Hash and Tie::StdHash (or the whole
> Tie Bundle) on my PC but cannot find the modules in
> the perl repositories I have setup. (ppm 2.1.2 does
> not have a option to list the repositorie
On Thu, 25 Sep 2003 13:05:28 +0100
"Dillon, John" <[EMAIL PROTECTED]> wrote:
> 'Can't locate Email/Find.pm in @INC <@INC contains: C:/Perl/lib
> C:/Perl/site/lib.> at F:\getemails.ph line 1'
>
> Indeed line 1 does say:
>
> 'use Email::Find;'
>
> Hm. It seems I haven't installed Email::Find,
> You want to extract numbers from an array
> if they are > 4 and put an 'a'-letter after them.
Try this...
# tested
@values = (1,3,5,7);
@bigger_than_4 = map {$_.'a'} grep {$_>4} @values;
print "@bigger_than_4";
> You need to escape a loop with a value.
Not sure I understand what you are tryin
First, thank you for your help. Second, please bear with me as I'm a
perl noob.
I assume that $_ is the last thing gotten by . will regexes
always default to using $_? I think that's right, but when I try:
while (!( =~ /QUIT/))
{ push @stack, $_; }
print @stack;
it doesn't pri
--Dan Anderson wrote:
I have some CSS questions. Can anyone recommend a good mailing list?
How about usenet? Try comp.infosystems.www.authoring.stylesheets
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
while ()
{
if (/QUIT/)
{ last; }
push @thestack, $temp;
}
> How can I do this?
You can do it like this...
# tested
my @stack;
while () {
last if /QUIT/;
push @stack, $_;
}
print "@stack";
Rob
-Original Message-
From: Dan Anderson [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 8:23 PM
To: Perl Newbies
Subject: How do I to a
Shortly, I think it might be good if loops (etc.) could return values.
Example 1: Retnext (like 'return next' borrowed from pl/sql)
You want to extract numbers from an array if they are > 4 and put an
'a'-letter after them.
@values=(1,3,5,7);
@bigger_than_4= # get
Is there an easy way to read into a stack until some pattern is
matched and then break. I tried all sorts of (error producing) code,
but nothing seemed to work. I ended up with:
#! /usr/bin/perl
#can I make this more concise?
$infinite_loop = 1;
while ($infinite_loop)
{
$temp = ;
if ($temp
Dear Friends,
I have perl 5.6.0 for windoze and ppm 2.1.2. I like
to install Tie::Hash and Tie::StdHash (or the whole
Tie Bundle) on my PC but cannot find the modules in
the perl repositories I have setup. (ppm 2.1.2 does
not have a option to list the repositories I have
setup).
Can anyon
Thanks a lot, thats exactly what I wanted
On Thu, 25 Sep 2003, Pete Emerson wrote:
> Asif Iqbal wrote:
>
> > I can use this to get all the env variables
> ...
> > Now how can I use this trick to get all the web env variables ? I am using
> > apache on unix (solaris 8) ?
>
> It's the same way. Her
On Thu, 25 Sep 2003 16:03:27 -0500, "JOHN FISHER" <[EMAIL PROTECTED]> wrote:
> I have successfully used zgrep in a script and loved every minute of it (still wet
> behind the ears).
> sub pulldata
> {
> my $data = `zgrep $key $wh
John Fisher wrote:
>
> I have successfully used zgrep in a script and loved every minute of
> it (still wet behind the ears).
> sub pulldata
> {
> my $data = `zgrep $key $whichfile`;
> print $data;
> }
>
> That command ran thru the whole zip file and dumped all the
Has anyone try to delay loading the Statistics module by using autouse? I
can't get it to work.
The usual usage without autouse is this:
use Statistics::Descriptive;
$stat = Statistics::Descriptive::Sparse->new();
But if I autouse with this syntax:
use autouse 'Statistics::Descriptive';
$stat = S
I have successfully used zgrep in a script and loved every minute of it (still wet
behind the ears).
sub pulldata
{
my $data = `zgrep $key $whichfile`;
print $data;
}
That command ran thru the whole zip file and dumped all the data, which for that app
was just one
Asif Iqbal wrote:
I can use this to get all the env variables
...
Now how can I use this trick to get all the web env variables ? I am using
apache on unix (solaris 8) ?
It's the same way. Here's code that works for me:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header;
print st
I've browsed CPAN. I've Googled. I'm stumped.
I've successfully used PDF::Parse to get at PDF metadata. But I can't
get at the content. Is there a way in perl to extract the contents of a
PDF file?
Last resort will be to use pdftotext or a similar converter, but if I
can go native, so much the
Hi all
I am a newbie in perl.
I can use this to get all the env variables
#!/bin/perl
foreach $key ( sort keys %ENV )
{
print "$key $ENV{$key}\n";
}
Now how can I use this trick to get all the web env variables ? I am using
apache on unix (solaris 8) ?
Please help
Thanks
--
Asif Iq
> I see two ways of writing this code.
Hmmm, how about a third way. The following code dynamically loads a module
based on the extension of the file. If it successfully loads the module it
instantiates a new object and calls the handle_file() method of the object.
This accomplishes a few things
On Thu, 25 Sep 2003 12:10:15 +0530, Chetak Sasalu M
<[EMAIL PROTECTED]> wrote:
Hi,
How can I extract "filename" from /root/dir1/.../filename
$path_name='/root/dir1/.../filename';
my $fname=substr($path, rindex($path,"/")+1,length($path)-rindex($path,"/")-
1);
Cheers,
Chetak.
--
wbr,
Juris
--
To
I posted the other day a question about writing a daemon to monitor
a directory and then process the files as they arrive in said directory. I
will begin working on this shortly, but I have a related question and this I
think is mainly a question of good coding practice. Eventually, there
Dillon, John [mailto:[EMAIL PROTECTED] asked:
> Is there a gobble-di-gook looker-upper for perl. For
> instance, if I don't
> know what '@_' is saying, as in:
>
> my($email, $orig_email) = @_;
Look at the perlvar manpage. @_ is the array that has the
parameters passed to a function.
The above
On Thu, 25 Sep 2003 19:34:52 +0530, "Chetak Sasalu M" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> Any place to ask perl-xml questions and questions about schema?
All of the lists hosted by perl.org are available on a Lists List page at:
http://lists
Hi,
Any place to ask perl-xml questions and questions about schema?
Thanks
Chetak
Ignore dis below ;-)
-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 7:30 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: R
On Thu, 25 Sep 2003 12:15:18 +0530, "Chetak Sasalu M" <[EMAIL PROTECTED]> wrote:
>
> Namaskara!
>
>Can anybody suggest a simple way to add or remove an attribute to the
> root element in an xml file ?
>
Check out the XML::Simple module fr
On Thu, 25 Sep 2003 08:09:23 +0200, [EMAIL PROTECTED] wrote:
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 24, 2003 3:29 PM
> To: [EMAIL PROTECTED]
> Subject: Perl-TK: how to get
Dillon, John [mailto:[EMAIL PROTECTED] asked:
> When I am in a black command.com screen with CPAN> prompt,
> where am I? Why can't I cd to c:\?
That would be the CPAN prompt. Try "help" for a terse
command listing, "quit" to exit back to the DOS prompt.
CPAN is the Perl module installer. Check
I'm getting the idea that CPAN is a gateway from the command screen to the
world wide network of ftp sites. I tried 'perl -MCPAN -e shell' and
'install Email::Find' and got a lot of activity. But going back to c:\ and
running my 'getemails.pl' file, I get:
'Can't locate Email/Find.pm in @INC <@I
> When I am in a black command.com screen with CPAN> prompt, where am I? Why
can't I cd to c:\?
Because you're in the CPAN shell. You can ues this to download and install CPAN Perl
modules. If you type:
install Email::Find
You can go back to the command prompt by typing 'exit' and get help by t
When I am in a black command.com screen with CPAN> prompt, where am I? Why
can't I cd to c:\?
John
http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are
confiden
Is there a gobble-di-gook looker-upper for perl. For instance, if I don't
know what '@_' is saying, as in:
my($email, $orig_email) = @_;
getting there...
-Original Message-
From: Stephen Hardisty [mailto:[EMAIL PROTECTED]
Sent: 25 September 2003 11:43
To: Stephen Hardisty; Dillon, John;
James Edward Gray II wrote:
>
> I would like to add some code to a sub that only needs to be run
> the first time the sub executes, or before is fine. If I add an
> INIT { } block at the beginning of the sub, would that do it?
>
> Are there other ways?
Nobody seems to be encouraging you to go f
> If ppm doesn't work, try 'perl -MCPAN -s shell'.
Oops, it's 'perl -MCPAN -e shell'.
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
s
Hi,
it's 'Email::Find'. You can get information on this from:
http://search.cpan.org/author/MIYAGAWA/Email-Find-0.09/lib/Email/Find.pm
If ppm doesn't work, try 'perl -MCPAN -s shell'.
Cheers!
-Original Message-
From: Dillon, John [mailto:[EMAIL PROTECTED]
Sent: 25 September 2003 11:24
To
What I am eventually trying to do is get the email addresses from my Outlook
into a list. I found the following example for Eudora which I want to
adapt, unless you know an easier way:
perl -Memail::find -ne 'email::find->new(sub { print shift->address, "\n"
})->find(\$_)' file.mbx > output.txt
Yes, a while loop that does not terminate how I would write a daemon (in
any language). Suggest having it touch a "heartbeat" file every cycle
and/or write state data to this file for monitoring and if you are
running it on Unix/Linux put it under daemontools
(http://cr.yp.to/daemontools.html) for
Hi -
I just installed perl-5.8.0 from source, in the shell
(perl -MCPAN -e shell) I tried to "install LWP" but
had some problems until I added an *incorrect*
hostname to the 127.0.0.1 line in /etc/hosts
my resolver provides correct reverse dns, how do
I use that? and how do I manually set the hos
59 matches
Mail list logo