Jeroen Lodewijks wrote:
> Hi all,
>
> Is there anybody out there who has a code snippet to test if a list is empty?
> (a list is empty if all elements are either undefined or 0 or have an empty
> string)
>
> Ofcourse I can do this:
>
> my $str = '';
> my $elem;
>
> my (@test) = (undef, ''); #put a
Rob Dixon wrote:
> Hi Scott, Francesco.
>
> Scott R. Godin wrote:
> > Francesco Del Vecchio wrote:
> >
> > > suppose this:
> > > ==
> > > $string 'I saw Roger and I said :roger? what the @*$!';
> > >
> > > $var1 = "roger? what the @*$!";
> > > $var2 = "Hi roger.
Jenda Krynicky wrote:
> Welcome to psh 0.7.1 by [EMAIL PROTECTED]
> Running under Perl 5.008
>
> psh$ do {print '.';print ':';} while ($x++ < 10);
> .:.:.:.:.:.:.:.:.:.:.:
> psh$ do {print '.';print ':';} while ($x++ < -10);
> .:
> psh$ do {print '.';print ':';last} while ($x++ < 10);
> .:
> c:\te
> > > - easier for other people to maintain even years from now
> > > - easier to migrate and expand
> > > - objects make it easier to interface and work with other things,
> > > consistantly and without much effort
> > > - decrease cost( time, money, space, prcessing power )
> >
> > Agreed, agre
> Sorry to harp on this, but a lock file will not work in every
> case. Shared
> memory will not work. Every implementation of this results
> in code that has
> to:
>
> 1) check for lock
> 2) lock
The following should be atomic, and thus can be used for a **simple**
locking mechanism:
use Fc
> -Original Message-
> From: Bakken, Luke [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 06, 2003 4:47 PM
> To: Michael Weber; [EMAIL PROTECTED]
> Subject: RE: Handling race conditions
>
>
> It sounds like you need two things:
>
> 1. A faster way of storing "seen" IPs.
> 2. A lock mec
James Kipp <[EMAIL PROTECTED]> writes:
>
> Thanks Steve.
> So I could use either one of these methods, like:
>
> # skip dirs with Profile
> find {
> preprocess => sub { grep !/Profile/, @_ },
> wanted => sub { print if ($File::Find::name =~ /.*\.pst$/) }
> }, 'f:/users/user1';
Meriwether Lewis wrote:
>
> Hi Gurus!
Hello,
> I currently am displaying a list of choices for
> the user to select:
>
> 1. 1996 Corvette
> 2. 2001 Hummer
> 3. 1985 Blazer
> 4. 1987 Firebird
>
> I'm asking the user to enter a comma separated
> list of their choices.
>
> If the user enters:
>
Steve's suggestions worked great for ignoring or not recursing directories,
but I am unable to filter out all directories not named "My Documents" . I
have tried using regex and grep to filter them out but no luck
this fails, just goes to the root directory and exits, and the docs really
don't sa
Madhu Reddy wrote:
>
> Hi,
Hello,
> I want to check for some ASCII chars in perl like
> following "C" code..
The following code checks for "printable" characters not ASCII
characters.
> How to do this in Perl ?
> follwing will work in perl ?
>
> for($i=0;$i < length;$i++) {
> if (($_[$i] <
David --- Senior Programmer Analyst --- Wgo Wagner wrote:
>> i don't thing the above will work. try:
>>
>> for(split(//)){
>> if(ord < 32 || ord > 126){
>> print "Char is non printable char\n";
>> }else{
>> print "$_\n";
>> }
>> }
>>
>> david
>
> I got it to run but I had to add () to each ord
David Zhuo wrote:
> On Friday 07 March 2003 13:26, Madhu Reddy wrote:
>> Hi,
>> I want to check for some ASCII chars in perl like following "C"
>> code..
>>
>> How to do this in Perl ?
>> follwing will work in perl ?
>>
>> for($i=0;$i < length;$i++) {
>> if (($_[$i] < 32) || (($_[$i] > 126)) {
Rob Dixon wrote:
>
> John W. Krahn wrote:
> > Greg Carrara wrote:
> > >
> > > Hello,
> >
> > Hello,
> >
> > > I'm trying to write a script that reads a file line by line and if
> > > the line contains a space it puts quotation marks around it and
> > > writes it to another file. I mostly have thi
On Friday 07 March 2003 13:26, Madhu Reddy wrote:
> Hi,
> I want to check for some ASCII chars in perl like
> following "C" code..
>
> How to do this in Perl ?
> follwing will work in perl ?
>
> for($i=0;$i < length;$i++) {
> if (($_[$i] < 32) || (($_[$i] > 126)) {
> print "Char is non printable
Hi Gurus!
I currently am displaying a list of choices for
the user to select:
1. 1996 Corvette
2. 2001 Hummer
3. 1985 Blazer
4. 1987 Firebird
I'm asking the user to enter a comma separated
list of their choices.
If the user enters:
1,3,4
I need to store the year and make of their
selection
Hi,
I want to check for some ASCII chars in perl like
following "C" code..
How to do this in Perl ?
follwing will work in perl ?
for($i=0;$i < length;$i++) {
if (($_[$i] < 32) || (($_[$i] > 126)) {
print "Char is non printable char\n";
}
}
following is C code
for(i=0;i<(int)strlen(Buffer);
I am very new to perl.
i need to write a simple user log system
if you go to
http://apidb.org/regstragreement.html
after you click agree, you will be direct to regiser page.
http://apidb.org/regstr.html
now if you click directly
http://apidb.org/regstr.html
you will be able to go to the same
Paul wrote:
>
>
> Agreed, agreed, agreed, agreed, and agreed, but they don't take my word
> for it. I need a way to prove it. :o/
>
the very fact that Perl supports OO is the prove that Larry thinks OO is a
good thing. Now tell me your coworkers don't take Larry's work. :-)
david
--
To unsub
> Of course.
>
> #!/usr/bin/perl -l
>
> use File::Find;
> use warnings;
>
> #
> # ignore
> #
> find {
> preprocess => sub { grep $_ ne __FILE__, @_ },
> wanted => sub { print }
> }, ".";
>
> #
> # don't recurse
> #
> find sub {
> if ($_ eq __FILE__) { ++
You should really get one of the fine Perl books by O'reilly or spend at
least a little time learning Perl. The eample below example will take a
user supplied regex pattern and search for those lines that contain the
regex and precede the line with a '#'.
Here is an example:
#!/usr/bin/perl -w
#
Hi perlians,
How can make to open a file and search on it some character to remove or
comment. Sorry but I'am a newbie++newbiw about the fantastic language Perl
and now for me it's very difficult approach an algorithm.
Does someone here can you help me with small example.
Many thanks at all.
Mar
James Kipp <[EMAIL PROTECTED]> writes:
> Is there a way to get File::Find to TOTALLY ignore a directory??
Of course.
#!/usr/bin/perl -l
use File::Find;
use warnings;
#
# ignore
#
find {
preprocess => sub { grep $_ ne __FILE__, @_ },
wanted => sub { print }
}, ".";
Hi
Is there a way to get File::Find to TOTALLY ignore a directory?? See
comments in code for what I mean:
find ( \&wanted, 'f:/users/user1');
sub wanted
{
## HERE: even though it returns when it sees a dir called
# with Profile, it comes right back to where it left of, in other
On Fri, 7 Mar 2003 07:56:29 -0800 (PST), Paul <[EMAIL PROTECTED]> wrote:
>
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > A noble task indeed!
> > I don't know of any links right off but here's a couple shorties :
> > - easier for other people to m
On Fri, 7 Mar 2003 16:42:39 +, [EMAIL PROTECTED] wrote:
> Hi all
>
> perl script below works, and does what I hoped it would, but I don't seem
> to understand how to get it to print out the result to a new file as
> opposed to stdout.
>
> Tha
On Fri, 7 Mar 2003 09:29:25 -0600 , Jensen Kenneth B SrA AFPC/DPDMPQ <[EMAIL
PROTECTED]> wrote:
> Perldoc's aren't available on our systems. Guessing they were not part of
> perl4, or were not installed when perl4 was installed. Are the perldocs
>
> Hi all
>
> perl script below works, and does what I hoped it would, but
> I don't seem to understand how to get it to print out the
> result to a new file as opposed to stdout.
>
> Thanks for any help
>
> #!/usr/bin/perl -w
> use strict;
> use HTML::Parser;
>
> open(OUT, ">/share/file1")
You need to specify the filehandle when you print, the default is STDOUT.
text_h => [sub{ print OUT shift;}, 'dtext'],
start_h => [sub{ print OUT shift;}, 'text'],
end_h=> [sub{ print OUT shift;}, 'text']);
...At least I think that should work.
Rob
-Original Message-
From: [EMAIL
What is the exact error? It should give a pretty good hintn as what is
going on. If you don't have access to the web logs, try using "use
CGI::Carp qw(fatalsToBrowser);" at the top of the script.
Rob
-Original Message-
From: Mr. Horace Franklin Jr. [mailto:[EMAIL PROTECTED]
Sent: Frida
Hi all
perl script below works, and does what I hoped it would, but I don't seem
to understand how to get it to print out the result to a new file as
opposed to stdout.
Thanks for any help
#!/usr/bin/perl -w
use strict;
use HTML::Parser;
open(OUT, ">/share/file1") || die "Cannot open /share/fil
>
> Clear DayI tired to run the script below on my host server
> and it would not run. The server cannot find Taintcheck or
> Timefuncs. I uploaded these pm file to the server. What did
You don't simply upload the pm files they have to be instsalled
On the server.
Perl -MCPAN -e shell
CPAN
Clear DayI tired to run the script below on my host server and it would not run.
The server cannot find Taintcheck or Timefuncs. I uploaded these
pm file to the server.
What did I do wrong?
Is Apache the problem?
SERVER INFORMATION:
Path to Perl: /usr/local/bin/perl
Path to Sendmail: /usr/sbi
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > A noble task indeed!
> > I don't know of any links right off but here's a couple shorties :
> > - easier for other people to maintain even years from now
> > - easier to migrate and expand
> > - objects make it easier to interface and work with other t
You're right! I posted before I realized. But thanks to all who responded.
I can do exactly what I need!
-Original Message-
From: Mark Anderson [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 5:47 PM
To: Carrara, Greg; [EMAIL PROTECTED]
Subject: RE: trying to match variable name
> > - easier for other people to maintain even years from now
> > - easier to migrate and expand
> > - objects make it easier to interface and work with other things,
> > consistantly and without much effort
>
> I agree with what Dan said, but I think it is important to emphasize
> the very impo
Meriwether Lewis wrote:
> Hi Experts!
>
> Hoping someone can help me out. Here goes...
> bear with me, please.
> I have a file that contains a few email
> addresses. I read this file and push each line
> into an array:
>
> push(@AddrArray, $_);
>
> Then I do a foreach on the contents of the
> arra
Perldoc's aren't available on our systems. Guessing they were not part of
perl4, or were not installed when perl4 was installed. Are the perldocs
available on the web?
-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 7:11 PM
To: Jensen Ke
Hello Jeroen.
Jeroen Lodewijks wrote:
> Hi all,
>
> Is there anybody out there who has a code snippet to test if a list
> is empty? (a list is empty if all elements are either undefined or 0
> or have an empty string)
>
> Ofcourse I can do this:
>
> my $str = '';
> my $elem;
>
> my (@test) = (unde
--- Dan Muey <[EMAIL PROTECTED]> wrote:
> A noble task indeed!
> I don't know of any links right off but here's a couple shorties :
> - easier for other people to maintain even years from now
> - easier to migrate and expand
> - objects make it easier to interface and work with other things,
> con
On Fri, 7 Mar 2003 09:20:42 -0600, "Dan Muey" <[EMAIL PROTECTED]> wrote:
> A noble task indeed!
>
> - easier for other people to maintain even years from now
> - easier to migrate and expand
> - objects make it easier to interface and work with o
> > CPAN> install Bundel::CPAN
> ^^
>
> Hmm, that should be Bundle, shouldn't it ?!
Good point. I typed that part in then decided to show the output so I pasted that in.
Anither victum of hunt and peck!! ;p
>
>
> Cheerio,
> Janek
>
>
--
To unsubscribe, e-mail: [EMAIL PR
Hi Scott, Francesco.
Scott R. Godin wrote:
> Francesco Del Vecchio wrote:
>
> > suppose this:
> > ==
> > $string 'I saw Roger and I said :roger? what the @*$!';
> >
> > $var1 = "roger? what the @*$!";
> > $var2 = "Hi roger...nice to meet you";
> >
> > $string=~
A noble task indeed!
I don't know of any links right off but here's a couple shorties :
- easier for other people to maintain even years from now
- easier to migrate and expand
- objects make it easier to interface and work with other things, consistantly and
without much effort
- decrease cost(
Hi Scott.
Scott R. Godin wrote:
> Rob Dixon wrote:
>
> > Paul Johnson wrote:
> > > Rob Dixon said:
> > >
> > > > $data =~ m/ <([^>]*)> /x;
> > > > my $newdata = $1;
> > >
> > > And if the match fails?
> >
> > Well I think it's likely that you'd want to do:
> >
> > $data =~ m/ <([^>]*)>
On Fri, 07 Mar 2003 05:53:54 -0500, Jeroen Lodewijks wrote:
> Hi all,
>
> Is there anybody out there who has a code snippet to test if a list is empty?
> (a list is empty if all elements are either undefined or 0 or have an empty
> string)
>
> Ofcourse I can do this:
>
> my $str = '';
> my $el
From: Jeff Westman <[EMAIL PROTECTED]>
> Jenda,
>
> You CANNOT do what you are suggesting.
I tried it. I DID!
I don't understand what's going on. It worked fine without any
warnings/errors yesterday.
And now it does not work at all neither in Perl 5.6.1 nor 5.8.
But if I look at the CommandP
* Pradeep Goel ([EMAIL PROTECTED]) wrote:
> its 3.0.1
> & perl is 5.8
In which case the command format is changed to
repository add RothConsulting http://www.roth.net/perl/packages
Ben Marsh
>
> & my time is quite bad these days :)
>
> Thanks & regards
> Pradeep
>
> - Original Messa
First, I'm really sorry...I didn't want to send you a personal email...I pushed Reply
instead of
Reply All
Second, Scott...you are great!...I solved my problem with your suggestion. Thank a
lot...this is a
great mailing list!!!
--- "Scott R. Godin" <[EMAIL PROTECTED]> wrote:
> Two things:
>
>
> "Jeff" == Jeff Westman <[EMAIL PROTECTED]> writes:
Jeff> According to the perl documentation because 'do' is a STATEMENT, you
Jeff> cannot use LOOP CONSTRUCTS (next, last).
Well, a do-block is not a statement, but an expression. do-block followed
by a semicolon would be a statement.
--
> "Dave" == Dave K <[EMAIL PROTECTED]> writes:
Dave> My guess is that at one time it was allowable. If someone knows what version
Dave> of Perl allowed loop control modifiers in do{ } blocks (or if they were
Dave> never allowed) I would like to know. I am using v5.8.0 and I was surprised
Dave>
Francesco Del Vecchio wrote:
> suppose this:
> ==
> $string 'I saw Roger and I said :roger? what the @*$!';
>
> $var1 = "roger? what the @*$!";
> $var2 = "Hi roger...nice to meet you";
>
> $string=~ s/$var1/$var2/;
> ===
>
Hi all,
Is there anybody out there who has a code snippet to test if a list is empty?
(a list is empty if all elements are either undefined or 0 or have an empty
string)
Ofcourse I can do this:
my $str = '';
my $elem;
my (@test) = (undef, ''); #put any test data here
foreach $elem (@test) {
suppose this:
==
$string 'I saw Roger and I said :roger? what the @*$!';
$var1 = "roger? what the @*$!";
$var2 = "Hi roger...nice to meet you";
$string=~ s/$var1/$var2/;
===
I'm having problemsdue (i suppose) to the spec
John W. Krahn wrote:
> Greg Carrara wrote:
> >
> > Hello,
>
> Hello,
>
> > I'm trying to write a script that reads a file line by line and if
> > the line contains a space it puts quotation marks around it and
> > writes it to another file. I mostly have this working except that
> > in the case of
Hello there,
I have a script that I hacked from cpanel to help me access a webmail MUA
that I installed. It works with opera and netscape but seems to hang in
IE. I don't know much about perl but am learning. Can someone point out
whats wrong with this script that would cuse it to hang in IE?
#!
Dan Muey wrote:
>> ([EMAIL PROTECTED](/home/dmuey):101)# perl -MCPAN -e shell;
>>
>> cpan shell -- CPAN exploration and modules installation
>> (v1.48) ReadLine support available (try ``install Bundle::CPAN'')
>>
>> cpan> relaod index
>> Unknown command 'relaod'. Type ? for help.
>>
>> cpan> r
Dan Muey wrote:
> I've also had trouble using CPAN and so I did the reload index
> mentioned in this thread and that seemed to go thought but I s
> til can't get it to go.
>
> It's the same error everytime ( diff module names of course ) :: could not
> open y... There is a direct
> perl -MCAPN =e
Rob wrote:
> Is there a perl command to list installed modules?
#!/usr/bin/perl
use warnings;
use strict;
foreach my $mod ( sort CPAN::Shell->expand("Module","/./") )
{
next unless $mod->inst_file;
print $mod->id;
print ": ", $mod->inst_version
if $mod->inst_version;
pri
Rob Dixon wrote:
> Paul Johnson wrote:
>> Rob Dixon said:
>>
>> > $data =~ m/ <([^>]*)> /x;
>> > my $newdata = $1;
>>
>> And if the match fails?
>
> Well I think it's likely that you'd want to do:
>
> $data =~ m/ <([^>]*)> /x or die "Malformed data";
>
> or at least:
>
> $data
David wrote:
> Gregg R . Allen wrote:
>
>> It was close but what I got is : "JohnDoe.com" Instead of
>> "[EMAIL PROTECTED]".
>>
>> I think it has something to do with escaping the "@" sign. I've been
>> experimenting, but without much luck.
>>
>
> that's because Perl thinks @Someplace is an
Jeff,
> Jenda,
>
> You CANNOT do what you are suggesting.
My guess is that at one time it was allowable. If someone knows what version
of Perl allowed loop control modifiers in do{ } blocks (or if they were
never allowed) I would like to know. I am using v5.8.0 and I was surprised
to try:
$ perl -
Thanks!
It did not work. I guess I have to figure out how the program was programed in order
to automate it using perl.
Dan Muey <[EMAIL PROTECTED]> wrote:Well it depends. Is this script on windows or unix?
I'm thinking unix due to the program name.
Can you do the same thing via the command li
I'm sold -- I write most code as object modules now.
Yes, it adds some work to make sure it's inheritable, and I have to
think whether a method can or must be called as a class method, or can
or must have an actual object. I've even written a couple that allow
non-class function-style use. My cow
On Fri, 2003-03-07 at 13:51, R. Joseph Newton wrote:
> Wiggins d'Anconia wrote:
>
> >
> > In general this would be handled with a lock file. When the first
> > instance of your script starts it would check for the lock file if it
> > exists then just exit, if it doesn't then it opens a file (.lock
65 matches
Mail list logo