But that's the rub ... Change the first line ... isn't it Nigel ?
if this is done in Windows, the script can get corrupted ...
the result is ^M's all over the place ...
When many of these scripts were first made available,
changes were made directly on the servers , usually with
telnet .
Yes of course ...
www.oreilly.com
has links to all source code for all it's books
It's one of the reasons this series of books is so affordable,
no cost of CD built in .. you just pay for the book ..
There are very few lemons in this series
regards
SunDog
=
On a Linux machine,
open up the script ... with Fox-Editor
Look for ^M 's remove them
If you have edited or configured this script using Windoze,
the CR\ LF is not compatible with New Line on ISO machines ...
regards
SunDog
==
On 23 May 2001, Randal L. Schwartz wrote:
> Casey> Don't forget to subscribe to the list(s) you're interested in.
>
> And those instructions are?...
[EMAIL PROTECTED] (as usual)
[EMAIL PROTECTED] (as usual too)
[EMAIL PROTECTED]
[EMAIL PROTECTED] (new digest)
or
http://learn.perl.org/ (there
--- David Michael <[EMAIL PROTECTED]> wrote:
> I need help. I am a newbie. I am frustrated.
> I am working with a dbm file. It has data in it. The data is
> formatted in this way:
>
> key = name: parameter\n name: parameter\n name: parameter\n
>
> I want to get rid of the 'name' and jus
> "perlguy" == perlguy <[EMAIL PROTECTED]> writes:
perlguy> On Wed, May 23, 2001 at 03:42:57PM -0700, Peter Scott ([EMAIL PROTECTED])
spew-ed forth:
>>
>> Okay, now I'm confused. I'm on [EMAIL PROTECTED] and I want to stay
>> there. You mean I have to resubscribe to it? How come I'm s
Hi guys,
I created the following script to logout users from a
unix system. Please take a look and let me know if
the syntax is correct.
#!/usr/bin/perl
#
#Purpose: To logout users off the system during after
hours.
#
sub DEBUG () { 1 }; # set level of debugness.
open (STDERR, "/tmp/userlog.log"
--- [EMAIL PROTECTED] wrote:
> The code fragment below is the bit I'm having issues with. I know
> that everything works as the commented print stmts work. When I try
> to return the value to the calling script I seem to be getting a
count
> of the elements of the array.
That sounds like a con
On Wed, May 23, 2001 at 03:42:57PM -0700, Peter Scott wrote:
: At 06:37 PM 5/23/01 -0400, Kevin Meltzer wrote:
: > > And which ones am I already subscribed? Wouldn't it have been easier
: > > to just subscribe across the board, then let us unsubscribe?
: >
: >E.. what is up with this new opt-
On Wed, May 23, 2001 at 03:42:57PM -0700, Peter Scott ([EMAIL PROTECTED]) spew-ed forth:
>
> Okay, now I'm confused. I'm on [EMAIL PROTECTED] and I want to stay
> there. You mean I have to resubscribe to it? How come I'm still getting
> its messages then?
N.. you are still subscribed to
>I just get tired of looking everything up in my Perl book.
Try perldoc ;)
$> perldoc chop
chop VARIABLE
chop LIST
chopChops off the last character of a string and returns the
character chopped. It's used primarily to remove the newline
from the end of an input
At 06:37 PM 5/23/01 -0400, Kevin Meltzer wrote:
> > And which ones am I already subscribed? Wouldn't it have been easier
> > to just subscribe across the board, then let us unsubscribe?
>
>E.. what is up with this new opt-out thing? :) We wouldn't want people to
>suddenly come back to check t
Very interesting,
Thanks for pointing that out. I looked that up and read the related
sections, good information to know. I had been using local() thinking it
worked as my() does. That has been corrected now.
Thanks for watching my back ;)
David
> From: Paul [mailto:[EMAIL PROTECTED]]
>
>
>
Hello,
I'm having a shot at writing a module for the first.
I am experiencing some issues returning an array.
The code fragment below is the bit I'm having issues with. I know that
everything works as the commented print stmts work. When I try to return the
value to the calling script I se
I need help. I am a newbie. I am frustrated.
I am working with a dbm file. It has data in it. The data is formatted in this way:
key = name: parameter\n name: parameter\n name: parameter\n
I want to get rid of the 'name' and just get the 'parameter'.
The parameter may have spaces in it,
On Wed, May 23, 2001 at 02:56:20PM -0700, Randal L. Schwartz ([EMAIL PROTECTED])
spew-ed forth:
> > "Casey" == Casey West <[EMAIL PROTECTED]> writes:
>
> Casey> Don't forget to subscribe to the list(s) you're interested in.
>
> And those instructions are?...
Look at the FAQ, or lists.perl.
--- David Blevins <[EMAIL PROTECTED]> wrote:
> local @fileList = reverse sort `ls $list*.list`;
> local $current = $fileList[0];
> local $previous = $fileList[1];
Local is great for a few things, but almost universally you should be
using my(). local() can cause you some real (and un
--- Peter Cline <[EMAIL PROTECTED]> wrote:>
> >ok, so the routine is in main:: namespace?
>
> Is it? Does require put its arguments into the namespace from which
> it was called?
Yep, I think so.
require 'x.pl';
is much the same as
eval `cat x.pl`;
Yes?
> > > use NYT::Cnxdb;
> > > my $c
Hello,
I'm learning Perl for fun and writing a little program as a learning
exercise. I've spend the last few years writing Java middleware and I'm
finding Perl to be extremely refreshing. There are so many things you can
do in Perl that would take many lines of code in Java. For example: @new
On Wed, May 23, 2001 at 02:56:20PM -0700, Randal L. Schwartz wrote:
: > "Casey" == Casey West <[EMAIL PROTECTED]> writes:
:
: Casey> Don't forget to subscribe to the list(s) you're interested in.
:
: And those instructions are?...
Just reply directly to the poster and add a Cc: for the righ
> "Ask" == Ask Bjoern Hansen <[EMAIL PROTECTED]> writes:
>> And which ones am I already subscribed? Wouldn't it have been
>> easier to just subscribe across the board, then let us
>> unsubscribe?
Ask> It's not polite to subscribe 800+ people to some new mailinglist
Ask> just like that.
If
- Original Message -
From: Yacketta,Ronald J <[EMAIL PROTECTED]>
To: Beginners (E-mail) <[EMAIL PROTECTED]>
Sent: Wednesday, May 23, 2001 10:52 PM
Subject: mail
> Folks,
>
> I search CPAN and found a good deal of Mail packages, seeing that I am
> frankly new
> which of them would you
On Wed, 23 May 2001, Me wrote:
> > ($router_table{i},$router_type{i}) = split(/\|/,
> > $router_tables{i});
>
> All those indices should be {$i} rather than {i}.
They are actually $i in the script, just typos in the mail...
appologies...
> > I'm figuring it's the {i} causing the prob
> "Casey" == Casey West <[EMAIL PROTECTED]> writes:
Casey> Don't forget to subscribe to the list(s) you're interested in.
And those instructions are?...
And which ones am I already subscribed? Wouldn't it have been easier
to just subscribe across the board, then let us unsubscribe?
--
Ra
> ($router_table{i},$router_type{i}) = split(/\|/,
> $router_tables{i});
All those indices should be {$i} rather than {i}.
> I'm figuring it's the {i} causing the problem
You had it figured...
On May 23, Andy Roden said:
>($router_table{i},$router_type{i}) = split(/\|/,
>$router_tables{i});
You probably want that to be $i, not i.
>if ($router_table{i} ne "") {
>print SH "\"$router_table{i}\" ";
>}
There too.
>else {
>print SH "\"$rout
The volume of the beginners list is amazing! IMHO, great job!
There are now two lists for beginners:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
I have made this decision based on what I believe to be the easiest
way to split things.
Don't forget to subscribe to the list(s) you're interested in.
THI
>
>ok, so the routine is in main:: namespace?
Is it? Does require put its arguments into the namespace from which it was
called?
> > use NYT::Cnxdb;
> > my $cnxdb =
> > Cnxdb->new($conf{cnxdbUser},$conf{cnxdbPort},$conf{cnxdbTimeout});
> > die("Unable to connect to database: " . $cnxdb->getla
ANyone help me out with a problem I'm having splitting some | separated
variables...
%router_tables contains entries like 0.0.0.0|unknown 1.1.1.1|cisco
2.2.2.2|juniper
foreach $i (sort keys %router_tables)
{
next if ($i =~ "unknown");
($router_table{i},$router_type{i}) = split
> Hi, I have a question regarding the following script.
> [code]
Did you write the code?
> This should be the output.
> [data1]
> However, the output is the following:
> [data2]
Did you know that [data2] is near enough just [data1], twice?
Which is probably because the somethings in this cod
Hi Paul, thank for your interest. I am talking
about multiple protein sequence alignments generated by the program
clustalW (see http://www.ebi.ac.uk/clustalw/help.html for additional information).
Since the sequences to be aligned can be very long, in the output clustalW
split the sequences
I am not sure what type of system you are on but if you are running the perl
script on a UNIX type of machine and sendmail is installed and functioning
then you may wish to resort to using a system() call at the end of your
script. (barring that this does not run every 5 seconds) My preference wh
--- Peter Cline <[EMAIL PROTECTED]> wrote:
> At 01:29 PM 5/23/01 -0700, you wrote:
> >I'm not sure what you mean by "multiple namespaces". Could you
> >elaborate?
>
> I am writing a module. This module has numerous packages which are
> what I am referring to (perhaps erroneously) as namespaces
Personally, I like the one liner:
open (LETTER, "|mailx -s \"TITLE HERE\" someone\@some-domain.com") || die
("cannot open mail");
Paul Jasa
Qwest Cyber.Solutions
(408) 281-5295
-Original Message-
From: Yacketta,Ronald J [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 1:52 PM
On Wed, May 23, 2001 at 04:52:06PM -0400, Yacketta,Ronald J wrote:
> Folks,
>
> I search CPAN and found a good deal of Mail packages, seeing that I am
> frankly new
> which of them would you recommend to use in a perl script that will be
> sending a single
> email at the completion of a set of ta
Folks,
I search CPAN and found a good deal of Mail packages, seeing that I am
frankly new
which of them would you recommend to use in a perl script that will be
sending a single
email at the completion of a set of tasks?
-Ron
==
__
/_/\ Ronald
At 01:29 PM 5/23/01 -0700, you wrote:
>I'm not sure what you mean by "multiple namespaces". Could you
>elaborate?
I am writing a module. This module has numerous packages which are what I
am referring to (perhaps erroneously) as namespaces. In this module file
is a use pragma/function that t
On Wed, May 23, 2001 at 03:32:18PM -0500, Tom Yarrish wrote:
> Okay, in answer to your question, my background is mainly in
> Network/System Administration. Starting on Windows systems, and then
> moving into Unix/Linux systems after that. I've played around a bit with
> VB and C++. I've never
Also try reading "Drawing on the Artist Within" by Betty Edwards. Through a
series of drawing excercises you will learn to look at problems in new ways,
and as a result, find creative solutions to any problem you're trying to
solve.
http://www.amazon.com/exec/obidos/ASIN/067163514X/o/qid=99065080
--- Pedro A Reche Gallardo <[EMAIL PROTECTED]> wrote:
> Hi, I have a question regarding the following script.
[snip]
> Heres is the question.
> This script should take an alignment with sequences spread in two
> or more blocks, and print them in one single block. Se below
Um, what does that mean
--- Dana Jansen <[EMAIL PROTECTED]> wrote:
> I want to create a script to allow a user to change their password.
> Any suggestions?
Millions (figuratively speaking, of course. =o)
In what context?
UNIX command-line for box login?
Web-based form for site access?
Windows script to change a network
--- Tom Yarrish <[EMAIL PROTECTED]> wrote:
> Hey all,
> Been reading the list for a little while, and had sort of a
> philosophy question for the group. I've been trying to learn Perl
> for some time (in fact, my company has offered to pay for me to take
> a Sun course on it).
> In the mean time
On May 23, Tom Yarrish said:
>Been reading the list for a little while, and had sort of a philosophy
>question for the group. I've been trying to learn Perl for some time
>(in fact, my company has offered to pay for me to take a Sun course on
>it). In the mean time I've been reading through the
Okay, in answer to your question, my background is mainly in
Network/System Administration. Starting on Windows systems, and then
moving into Unix/Linux systems after that. I've played around a bit with
VB and C++. I've never had any problems with syntax, it's been the
thought process behind it
> "FLAHERTY," == FLAHERTY, JIM-CONT <[EMAIL PROTECTED]> writes:
FLAHERTY,> Hello, I want to automatically get a receipt for a user when they read the
FLAHERTY,> email my script sends out . I have red hat 7.1
Be sure to include that in the instructions in the body of the message
then. Ther
--- Peter Cline <[EMAIL PROTECTED]> wrote:
> > > my $object = Class->new( );
> >
> > Looks ok. Can you access the objects methods thereafter in that
> > scope?
>
> Yes, I can access object methods anywhere in the file in which I
> created the object even though it has multiple namespaces.
I
Hi, I have a question regarding the following script.
#!/usr/sbin/perl
if (!@ARGV) {
print STDERR "usage: $0 alignment_file [threshold%]...\n";
print_sets();
exit 0;
}
my $FILE = shift @ARGV;
my @THRESHOLD;
if (@ARGV) {
@THRESHOLD = @ARGV;
} else {
@THRESHOLD = (90, 80,
On Wed, May 23, 2001 at 02:59:13PM -0500, Tom Yarrish wrote:
> Hey all,
>
> Been reading the list for a little while, and had sort of a philosophy
> question for the group. I've been trying to learn Perl for some
> time (in fact, my company has offered to pay for me to take a Sun
> course on it).
At 02:59 PM 5/23/01 -0500, Tom Yarrish wrote:
>What have people done/read/whatever
>to "think" in a perl state of mind.
Zen and the Art of Motorcycle Maintenance
Illusions/Richard Bach
Whack on the Side of the Head/van Oech
Any Far Side collection
>As I said, I've been trying for some time to le
I want to create a script to allow a user to change their password.
Any suggestions?
Dana M. Jansen
Hello, I want to automatically get a receipt for a user when they read the
email my script sends out . I have red hat 7.1
Thanks in advance
Jim
Hey all,
Been reading the list for a little while, and had sort of a philosophy
question for the group. I've been trying to learn Perl for some time (in
fact, my company has offered to pay for me to take a Sun course on it).
In the mean time I've been reading through the standard Perl books
(Lear
> "Timothy" == Timothy Kimball <[EMAIL PROTECTED]> writes:
Timothy> As for always getting that weird error message from $!, I always
Timothy> get "Illegal seek" on my machine.
You should never look at $! unless immediately following a *failed*
system-related call. A successful call doesn't
At 12:00 PM 5/23/01 -0700, Paul wrote:
> $object->method()
>passes $object to method much like
> Namespace::method($object);
Of course! I've been building perl objects over the last few days and taken
advantage of that property of method calls (obviously), but had forgotten.
> > my $object =
--- Peter Cline <[EMAIL PROTECTED]> wrote:
> Now I'd like to know if it is possible to pass an object as an
> argument to subroutine.
object method calls always do. =o)
$object->method()
passes $object to method much like
Namespace::method($object);
> I tried doing this as follows:
> in one
--- Paul <[EMAIL PROTECTED]> wrote:
>
> --- Jeff Pinyan <[EMAIL PROTECTED]> wrote:
> > On May 23, Paul said:
> > > local @ary = $hash_name->{arrayref}; # @ary now the array
> >
> > Err, I think you mean
> > local *ary = $hash_name->{arrayref};
>
> Yep, that was it.
To elaborate a bit on my
Thanks for all the responses to my question regarding deferencing a hash
reference which in turn references an array. I decided to use the arrow
operator.
Now I'd like to know if it is possible to pass an object as an argument to
subroutine. I tried doing this as follows:
in one file, the o
--- Jeff Pinyan <[EMAIL PROTECTED]> wrote:
> On May 23, Paul said:
> > local @ary = $hash_name->{arrayref}; # @ary now the array
>
> Err, I think you mean
> local *ary = $hash_name->{arrayref};
Yep, that was it.
__
Do You Yahoo!?
Yahoo! Auctio
Thank you Peter; that does the trick.
If the backtick command works (like `pwd`;) you get
$? = 0
$! = No such file or directory
But if you do e.g.
touch wibble
chmod -r wibble
then in Perl
`wibble` ;
you get
$? = 256
$! = Permission denie
I have a perl CGI script provided by Lancelot Securities in order to
synchronize a username/password file. Whenever a new user signs up (this is
to my understanding of how the script works by reading it, I have very
little knowledge in perl, and by reading the files) lancelot runs the script
by si
Enter:
perldoc perlvar
and then look at the entries for $CHILD_ERROR ($?) and $ERRNO ($!).
There can be other issues about return values, but start with the above.
Ron Mitchell wrote:
: I want to check that a backtick command has executed OK. I thought I could
: do that by looking at the $! variable.
Check $? instead. This one's for pipes, backticks, & system() commands.
It's a fairly complex flag, with a lot of stuff in it, but briefly,
$? >> 8 contains t
>I want to check that a backtick command has executed OK. I thought I could
>do that by looking at the $! variable.
Check $?
This is Child exit status which is what you get when you spawn another
process with back ticks.
The $! is the ERRNO (or Error string depending on context) for the last
sy
On May 23, Paul said:
>{ local @ary = $hash_name->{arrayref}; # @ary now the array
> print $ary[4]; # access is "normal"
>} # aliasing ends with scope
Err, I think you mean
local *ary = $hash_name->{arrayref};
That will make @ary an
--- Jeff Pinyan <[EMAIL PROTECTED]> wrote:
> On May 23, Peter Cline said:
> >Does anyone know a better way to say @{$$hash_name{arrayref}}?
>
> Doing $$foo{...} or $$foo[...] is often confusing for people to read.
> That's why the -> operator exists:
>
> $foo->{bar} # is like $$foo{bar}
> $
Hi.
Can someone explain this to me?
I want to check that a backtick command has executed OK. I thought I could
do that by looking at the $! variable. But I find that if I do this for
example
$output = `pwd` ;
print "$output\n" ;
print "\$! = $!\n" ;
I get
/home/ron
$! = No such file or direc
> "Brett" == Brett W McCoy <[EMAIL PROTECTED]> writes:
Brett> On Wed, 23 May 2001, Peter Cline wrote:
>> Does anyone know a better way to say @{$$hash_name{arrayref}}?
Brett> A hash containing an array reference?
Brett> How about
Brett> $hash_name{arrayref_name}->[0];
Brett> or @{ $hash_n
On Wed, 23 May 2001, Peter Cline wrote:
> Does anyone know a better way to say @{$$hash_name{arrayref}}?
A hash containing an array reference?
How about
$hash_name{arrayref_name}->[0];
or @{ $hash_name{arrayref_name} };
-- Brett
$test=~ s/(dav)/$1 Smith/ig;
print "$test
";
gives the following result:
dav Smithe Dav Smithid Dav Smithy
###
$test=~ s/(dav)w+/$1 Smith/ig;
Gives us: dav Smith Dav Smith Dav Smith
The \w+ says "one or more word characters". Sticking that on the end gave us a bit
more control over the resul
On May 23, Peter Cline said:
>Does anyone know a better way to say @{$$hash_name{arrayref}}?
Doing $$foo{...} or $$foo[...] is often confusing for people to read.
That's why the -> operator exists:
$foo->{bar} # is like $$foo{bar}
$foo->[$i] # is like $$foo[$i]
So you could write:
@
Does anyone know a better way to say @{$$hash_name{arrayref}}?
thanks
Peter Cline
Inet Developer
New York Times Digital
--- David Gilden <[EMAIL PROTECTED]> wrote:
> $test = "dave David Davy";
>
> ### Does not work want to count the number of matches...
> $regex= ($test=~ s/(dav)/$i++ $1/eig);
Just counting? Don't use s///. Try this:
my @regex = $test =~ /(dav)/g; # returns list of all matches
$i = sca
japhy wrote:
: On May 23, Timothy Kimball said:
:
: >2. Use the "s" modifier to treat the slurped-up file as a single string.
:
: The /s modifier changes the meaning of . only, and not ^ or $ -- see my
: response.
I stand corrected. In my defense, I don't use either of these modifiers
often. :
On May 23, David Gilden said:
>#!/usr/bin/perl
>
>$test = "dave David Davy";
>
>$i=0;
>
>### Does not work want to count the number of matches...
>$regex= ($test=~ s/(dav)/$i++ $1/eig);
>
>print "$regex $i\n";
Do you want to count matches, or change the string? If you just want to
count th
: ### Does not work want to count the number of matches...
: $regex= ($test=~ s/(dav)/$i++ $1/eig);
:
: print "$regex $i\n";
:
: ### This does work..
: $regex= ($test=~ s/(dav)/$1 Smith/ig);
:
: print "$regex\n";
:
: __END__
:
:
: It looks like $regex contains the number of matches,
Hello,
Thanks for all the help this list is providing,
Here is today's problem:
#!/usr/bin/perl
$test = "dave David Davy";
$i=0;
### Does not work want to count the number of matches...
$regex= ($test=~ s/(dav)/$i++ $1/eig);
print "$regex $i\n";
### This does work..
$regex= ($test=~
--- Timothy Kimball <[EMAIL PROTECTED]> wrote:
>
> Stefan Kyrytow wrote:
> : As you can see the last two inputs should not be accepted. I am
> using $x =~ /[0-9]/ as my filter. I understand why the values are
> being accepted, I am searching for a number and 12bob & bob12 each
> contain a number
At 02:15 PM 5/23/01 +0530, baby lakshmi wrote:
>hi
>I would like to know which part of my program is taking much time. IS that
>possible?
>if possible, can u tell me how to do it??
Oops, I just caught the subject. Your subject liine refers to memory
usage. Your text refers to time. Which is
--- Aaron Craig <[EMAIL PROTECTED]> wrote:
> I always that that modules were the domain of real Perl gurus, so I
> did a lot of requiring in my first Perl scripts. After running into
> all sorts of problems with namespace, especially for global variable
> names, I decided to check out modules.
--- Aaron Craig <[EMAIL PROTECTED]> wrote:
> At 15:12 22.05.2001 -0700, you wrote:
> > > > The problem is: PROTOTYPES MUST BE SEEN BEFORE THE FUNCTION IS
> > > > CALLED. So few people realize that (for one reason or
> > > > another[1]).
>
> > For that reason, I usually do my function definitions
Dear all,
Actually it does not depend on having an installation of Perl at all, let alone a sane
one. I am assuming
that the enquirer can take my supplied code, change the first line so that it points
to their Perl install
directory. Save it as test.pl in a suitable directory, change the permis
Check out Linuxnewbie.org. A great site, in a similar vein as Perl Monks. Tons and
tons of help there, and as the name implies it's geared toward promoting Linux and
it's use to neophytes and intermediate folk like myself.
~Matt C.
--- Tony Cook <[EMAIL PROTECTED]> wrote:
> On Wed, 23 May 2001
On May 23, Timothy Kimball said:
>2. Use the "s" modifier to treat the slurped-up file as a single string.
The /s modifier changes the meaning of . only, and not ^ or $ -- see my
response.
See chapter 5 of LPRE:
http://www.pobox.com/~japhy/docs/LPRE.html#5.%20more%20pattern%20modifiers
--
I strongly recommend that you let mod_perl do the apache build for you. Just make
sure it can find the src directory under apache.
Here's a script that I use. Hasn't failed me yet, although YMMV as I'm doing this on
Solaris and Linux, not HP-UX. Don't see why it would be significantly different,
: this is what i tryed on the command prompt.
:
: perl -pi -e 's{^
On May 23, pda said:
> and come to the new line and also check whether if there is a in
>the given file if it finds it has to replace with a other string.
>
>this is what i tryed on the command prompt.
>
>perl -pi -e 's{^
Hi, Does anybody have a sample script for loging out
users in unix? I need to logout all users except
root.
thanks,
=
Peter Lemus
UNIX/NT Networks Engineer
[EMAIL PROTECTED]
--This world is too big for us to be alone.
--A wise man will be master of his mind a fool will be its slave.
Hi,
I am facing problem to serach the new line also in the regular expression.
For example:-
I have a dbm file that i am trying to work with here. I am working with an established
format :
user = tagname: value\n tagname: value\n tagname: value\n...
The problem I am having is where I try to retrieve that value of the tagname.
dbmopen %PROXY, "$proxy", 0666 or die "Can'
Search for Basic Linux Training with Google. The blt list is for newbies.
John Gilger
On Wed, 23 May 2001 [EMAIL PROTECTED] wrote:
> Can anyone suggest mailing lists for Linux similar to this one?
On May 23, Kyrytow, Stefan said:
>Why they are called Regular Expressions, I am not to sure. They should be
>called Frustrating Expressions.
You might want to take a look at
http://www.pobox.com/~japhy/docs/LPRE.html
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~j
On May 23, Randal L. Schwartz said:
>> "Jeff" == Jeff Pinyan <[EMAIL PROTECTED]> writes:
>
>Jeff> if (length($x) and $x =~ /\D/) { fail() }
>
>Simpler...
>
>if ($x =~ /\d/ and $x !~ /\D/) { winner! }
Yeah, I was thinking of that too. merlyn++
--
Jeff "japhy" Pinyan [EMAIL P
> "Jeff" == Jeff Pinyan <[EMAIL PROTECTED]> writes:
Jeff> if (length($x) and $x =~ /\D/) { fail() }
Simpler...
if ($x =~ /\d/ and $x !~ /\D/) { winner! }
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/
On May 23, Jos Boumans said:
>Or a really one:
>
>if ($x =~ /\D/) {
>print "found non digit, do not pass go, no 20 grands for you";
>} else {
>print "good boy";
>}
>
>where \D stands for NON digits
The only problem is that "" passes that regex. For that reason, I would
suggest something
> "Nigel" == Nigel G Romeril <[EMAIL PROTECTED]> writes:
Nigel> Try something like;
Nigel> #!/usr/bin/perl -w
Nigel> print "Content-type: text/html\n\n";
Nigel> print "Hello world, it works!\n";
Nigel> This should print a line of black text on a white background if your path,
permissions et
Or a really one:
if ($x =~ /\D/) {
print "found non digit, do not pass go, no 20 grands for you";
} else {
print "good boy";
}
where \D stands for NON digits
regards,
Jos Boumans
"Brett W. McCoy" wrote:
> On Wed, 23 May 2001, Kyrytow, Stefan wrote:
>
> > As you can see the last two i
On Wed, 23 May 2001, Kyrytow, Stefan wrote:
> As you can see the last two inputs should not be accepted. I am using $x =~
> /[0-9]/ as my filter. I understand why the values are being accepted, I am
> searching for a number and 12bob & bob12 each contain a number.
>
> What I do not understand is
Stefan Kyrytow wrote:
: As you can see the last two inputs should not be accepted. I am using $x =~
: /[0-9]/ as my filter. I understand why the values are being accepted, I am
: searching for a number and 12bob & bob12 each contain a number.
:
: What I do not understand is how to search for jus
Why they are called Regular Expressions, I am not to sure. They should be
called Frustrating Expressions.
Once again I have what should be a simple problem and yet the solution
eludes me. I am creating a prompt that can only accept a number, it works
but with one exception, when someone enters a
Ron Yacketta wrote:
: I finally got a few books from O'Reilly, I truly am enjoying reading "Perl
: Cookbook"
: I was wondering if any of these complete scripts are available online for
: download?
All the examples from the book are available as a .tzr.gz or .zip file
from http://examples.oreilly
1 - 100 of 118 matches
Mail list logo