;icqmail.com]
Sent: Thursday, October 24, 2002 7:40 AM
To: [EMAIL PROTECTED]
Subject: detecting visually similar strings
hi,
i want to develop a perl module to determine whether two strings are too
visually similar. for example, ella (double lowercase ell) and
e11a (double 1 digit). so this is kind
I have a few ideas that may help:
Try making it so when page one loads the password form to fill out, it
includes a 'hidden' input type with a token value. (For this situation, it
won't matter that it is not really hidden when users view the HTML source if
your worried about that.)
What it
is wrong (in the
while loop), and so the loop is infinite, and no values are printed--just .
I'm just learning perl, and RegEx is really confusing to me. Any feedback
would be appreciated!
Thanks!
Josh
begin code
#!usr/bin/perl
#Exercise 8.9
#To determine how many HTML tags
is wrong (in the
while loop), and so the loop is infinite, and no values are printed--just
. I'm just learning perl, and RegEx is really confusing to me. Any
feedback would be appreciated!
Thanks!
Josh
begin code
#!usr/bin/perl
#Exercise 8.9
#To determine how many HTML tags
the
removal tool.
Please stay alert. The infected computer probably contains other
email adresses from 'perl.beginners' list members, so everybody on
the list could receive the virus, and not necessarily with a subject
or (part of) an email address related to Perl!
--
felix
--
To unsubscribe, e-mail
' where the regex can't.
I think it's because the whole file is not getting read into my $searchData
variable.
I think that Perl may be seeing some of that gibberish as a EOF signal, and
quitting the read-in.
In one case, my program thinks a 10,752 byte file should load as a 6
character string
Hi Paul,
Thank you for taking the time to help.
foreach my $fileName (@list) {
chomp($fileName);
my $duhFileName = $fileName;
#okay, I need help with scope too :-)
You sure you didn't just misspell the variable name?
It's case
be semi-binary data - these files weren't intended for
as-text reads.
I figured if old Notepad can load it completely and have what I need to
match visible as plain text amongst the garble, then Perl can do it no
sweat. I'm sure it can of course, but the trouble is figuring out how
Can I
bingo!
That fixed it!
Thanks agian
-Original Message-
From: Wagner, David --- Senior Programmer Analyst --- WGO
[mailto:David.Wagner;freight.fedex.com]
Sent: Thursday, November 14, 2002 4:25 PM
To: 'Perl'; Wagner, David --- Senior Programmer Analyst --- WGO
Cc: [EMAIL PROTECTED]; [EMAIL
I'm trying to make a page redirect to a homepage if a user has logged in
before. I have everything running except the redirect command. Here's what
I have:
print redirect ( homepage.pl );
It gives me a message on the page that says:
Status: 302 Moved location: homepage.pl
What am I
This should work (but beware - it is untested :)
Rob
my @required = qw(head1 head6 head8);
my $line;
for (DATA)
{
chomp;
my @field = split /,/;
my %column; # hash relating column header to column
index
next unless @field;
Sorry - to check that the headers exist change the first part of the if()
statement to:
if ($line++ == 0)
{
my $i;
$column{$_} = $i++ foreach @field;
foreach (@required)
{
die Column $_ doesn't exist
http:[EMAIL PROTECTED]/
Rob
Ramprasad [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi all,
Is there a FAQ digest of this newsgroup I can download and go through
Thanks
Ram
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Can anyone tell me where to find out what the x does when used at the end
of a pattern match? (i.e. $tag =~ /abc/x) Everywhere I've looked gives
me the helpful information that it means Use extended regular
expressions, but I've yet to find a definition of what that *means*.
Thanks...
--
Burnard wrote:
Hi,
I'm in the midst of writing my first useful perl script. It's designed to
pull text out of a plain text file and write a xml plist.
The only trouble I'm having (so far) is getting the text out the way I want
it.
The file I'm pulling data out of is formatted like
Ok, found out why I am getting this error...
Premature end of script headers
What does that mean??
Anyone?
This file works on my computer but when I upload it to a unix system and
try it from the internet it gives me a 500 error. Can anyone tell me what
the problem is?? Still new at perl
area of the file.
I would appreciate any help in resolving this issue as well as any
comments on better coding practices.
Regards,
Jack
#!/usr/bin/perl
#
# cur2sql.pl
#
use strict;
use vars qw($proc_begin $proc_end);
use vars qw($quote_date $cur_sym $cur_desc $usd_unit $units_usd
yeah just type : 'free'
Ryan
On Tue, 19 Jun 2001, Chris Hedemark wrote:
Howdy,
I'm tearing through my O'Reilly books and the CPAN search trying to find a
module or built-in function call that will let me get statistics back from
the system regarding memory. I'm trying to find:
1) real
When you do : foreach $line (){
that will print the last line in
rename $line in the foreach statement to something different,
RYan
On Tue, 19 Jun 2001, Bob Mangold wrote:
I may have a bug somewhere in my code, but I can't find it. Before I look again
though please answer this for me.
Hi,
I would like to know if with a perl script you can get the size of a file ?
I need to get all the size of 250 files on 250 computers ...
thanx
To get the status message from a http request from lwp:
my $res = $ua-request($req);
my $errorCode=$res-status_line
Economic perl programming and perl debugging http://www.fluxcenter.com
I propoused thi logo for learn.perl.orgl, if you liked please
tell me so.And vote on this list.
http://perl.fluxcenter.com/images/learn_perl4.gif
The logo is the same size as the 'Download Perl'
Button, is very fast. And mathes desing of learn.perl.org
The Brown and green are are to
resemble
I want to do this :
I have a file where there are 256 servers names, one server name per line.
I want to read all lines to take the names of all servers to check the size of
some files ...
I tried this but it's not working like I want .. :
$serveur=c:\\perl\\bin\\liste.txt;
open (SERV
I want to do this :
- get the size of some files with stat
- compare these sizes with some variables
- copy the good files if the size doesn't match ...
Hi,
I want to remplace all the word html in php in some web pages ...
I tried this but nothing is happening :
open (TRANS, c:\\test\\test.txt);
@transformation=TRANS;
foreach $ligne (@transformation)
{
chomp($ligne);
$transform=$ligne;
$transform=~s/html/php/g;
};
close (TRANS);
can someone give a name of any image (JPG or GIF) editing / creating module, which
allow to create images to display on web pages on the fly by CGI scripts.
Rakhitha M. Karunarathne
Trainee Software Developer,
IFS - R D International,
501,Galle Road ,Cololmbo-6, SRI LANKA.
Tel +94
I wrote some code to identify and print HTML tables below:
use strict;
my @table;
my $logfile;
my $counter;
my $inc;
my @array;
die You must enter an argument. \n if $#ARGV 0;
$logfile = chomp ($ARGV);
foreach my $line(){
if ($line =~ /(TABLE)(.+)/) {
$inc++;
Hi,
How do I best test for a valid host name? My script will read from a
file which contains IP addresses and/or dns name, so I'm trying to sort
out valid IP addresses or host name (using regex). For some reason, my
regex fails to match host names with one or more dash (-). IN the
example below,
Your regex did not allow (w2k-server-proxy2) a valid dns name.
I now see how complex it is to match valid ips or dns names.
The more I try to modify the regex to perfection, the more I see
hopholes. So I think it is not worthwhile spending lot of time on this
regex. My script does more than
Hi,
I installed few perl module locally and I
try to install another one which depends
on the previously installed ones (locally)
but I get the warning that these modules can not
be loaded
example:
billmax:~/src/perl/XML-DOM-1.43$ perl Makefile.PL
PREFIX=~/usr/local/lib/perl5
Checking if your
I am attempting to parse a log file that looks something like:
759033281 TE18 Vups_MsgStore constructor - add to MDBTable
EX:/O=MSGENG/OU=EUROPE/CN=RECIPIENTS/CN=PHARWOOD
759033281 TE18 Vups_MsgStore AddRef=2
EX:/O=MSGENG/OU=EUROPE/CN=RECIPIENTS/CN=PHARWOOD
759033281 TE18 MSM S-REXCH-MSG-07
Is there a way to make a from address other than an SMTP address? For
example, I want the From header to say something like, Web Log Report.
It doesn't have to be from a resolvable Internet address.
Is this possible? Does anyone know the correct syntax? Only way I get
this to work is by using ''.
: Friday, August 29, 2003 10:43 AM
To: [EMAIL PROTECTED]
Subject: Mod_Perl2 CGI.pm
Is mod_perl a replacement for CGI?
If just getting involved with perl and the web (Not new to perl) what is
the better option mod_perl or cgi?
This is on an apache server.
I choose mason thinking it was a replacement
to a webserver?
We have an intranet setup and I am creating a page that will allow are
adv dept to send out are weekly newsletter/fax.
The need to be able to upload the faxlist and the postscript file.
Once on the server I have a perl script that parses the fax list and
then sends the faxes
Sorry that this is ugly - I wrote it quickly one day...
It checks for the file, and makes sure the date stamp is within 10 minutes.
(Date::Manip was overkill for this). Who knows, I may have stolen this code
from someone else -- nah...too ugly.
#!/usr/bin/perl
use File::stat;
use Date::Manip;
my
Please help me parse this www.mydomain.com to just mydomain.com
Below are some scenarios in which all I want is the last two values,
mydomain.com :
mydomain.com = mydomain.com
www.yourdomain.com = yourdomain.com
www.station.fire.org = fire.org
results in just the base domain.
thanks
--
I want to parse a web log file that starts with the following lines:
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2001-12-07 21:36:29
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port
cs-username c-ip cs(User-Agent) sc-status
2001-12-07 21:36:29
Is this a current or outdated call? main'stderr
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Does anyone have a short routine for displaying mask on some values and
displaying the value of the last four? For example, alot of site display
credit card numbers like 1234 which shows only the last four.
I know how to use the substr but what about replacing the preceding values
with ?
How can I reuse a subroutine?
My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.99_07-5.
I've tried to put the sub in a separate file and call it from another as
below. Please modify the snipet below to make it work.
mycommon.pl
---
#!/usr/bin/perl
#return a value wrapped
.
It works for me:
[EMAIL PROTECTED] [11:47am] ~ #103 perl -l
$string = join '', .. 9;
substr($string, 0, -4, x x (length($string) - 4));
print $string;
__END__
xx6789
--
Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http
Is there a func or a onliner for removing blanks from both ends?
I'm using these:
$username =~ s/^\s+//;
$username =~ s/\s+$//;
There got to be one out there!
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
this looks convenience
thanks,
-rkl
[EMAIL PROTECTED] wrote:
Is there a func or a onliner for removing blanks from both ends?
I'm using these:
$username =~ s/^\s+//;
$username =~ s/\s+$//;
There got to be one out there!
Doing it in two steps is the way to go. Don't try to make one
That's some good stuff.
can you run a benchmark against these, contributed by others on this list,
as well?
$username =~ s/^\s*(.*?)\s*$/$1/;
$username =~ s/^\s*(.*?)\s*$/$1/;
thanks,
-rkl
I ran some benchmarks.
The two-liner outperformed the one-liners by a 10 to 1 ratio. Code and
This is the correct reply.
That's some good stuff.
can you run a benchmark against these, contributed by others on this list,
as well?
$username =~ s/^\s*(.*?)\s*$/$1/;
s/^\s+//, s/\s+$// $username;
thanks,
-rkl
I ran some benchmarks.
The two-liner outperformed the one-liners by a 10 to 1
Can someone help with build a simple module with one function in it?
Can't seem to get anythign working.
I guess something like:
test.pl
---
use mystuff;
print mystuff::trim($username);
mystuff.pm
--
#do i need any declaration line here
#is sub here or what?
#and where do i put
Since, everyone is so lively today, I'm going to push my luck today with
this list. I need a little help here with validating a string to have only
characters that I want, A-z and _ (underscore).
So, this is what I'm stuck on:
#should fail because of space
$username=bob by;
Lots of good stuff here. This oneliner is what makes perl cool but it's
like speaking in tongue -:)
sub isValidChars { shift =~ /^[A-Za-z_]+$/ }
Thanks,
-rkl
On Sep 29, [EMAIL PROTECTED] said:
Since, everyone is so lively today, I'm going to push my luck today with
this list. I need
as the
calling perl program. I got it working running on the command line but in
apache mod_perl, it can't find the module.
Questions:
- Where should the mystuff.pm be located in?
- The only place i know about mod_perl configuration file is:
/etc/httpd/conf.d/perl.conf. This contains the Alias
what is the proper way to pass a parameter for something like
$cgi-param(username)?
as far as i know it, this works for me:
$cgi-param(username);
$cgi-param(username);
$cgi-param('username');
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
is spelled last in Perl.
}
return $retval;
}
Here are a few variations:
sub isValidChars {
my $str = shift;
if ($str =~ /^[A-Za-z_]+$/) { return 1 }
else { return }
}
which can be written as simply
sub isValidChars {
return shift =~ /^[A-Za-z_
Is this doing what it is suppose to and how efficient?
rule
- valid chars A-z0-9 _ - .
- cannot start with a digit
- cannot start with a space
- must be greater than 3 in length
sub isValidChars
{ my ($z) = @_;
return length($z) 3 $z !~ /^[\d\s]/ $z =~ /^[\w.]+$/
}
thanks,
-rkl
--
To
How do you declare a var global versus local? It seems variables a local
and not static as in shell. That is, the sub does not see the vars from
the calling part. So, can someone modify the snipet to make it work?
a.pl
--
#my $x; any diff from the next line?
$x=abc;
doMe
sub doMe
{ $x=xyz;
Thanks for your help. I had tried the use lib path/to/module; and use
module; but it is still complaining about the use module part.
However, I took the easy route but may annoy structured folks, like perl
is very structured. I put it in /usr/lib/perl5/5.8.0
It works! Yippee! Perl programming
my redhat 9 is configured canned w/apache and mod_perl. The only
configuration I know is in /etc/httpd/conf.d/perl:
Alias /mp /var/www/mp
Directory /var/www/mp
SetHandler perl-script
PerlHandler ModPerl::Registry::handler
PerlOptions +ParseHeaders
Options +ExecCGI
put
Can a calling program reference a package variable?
It's not working for me.
test.pl
---
use fruit;
#I want to use this like a stub or struct
#this does not work - it errored
print mystuff::a;
print mystuff::b;
#this work
mystuff::mixIt;
fruit.pm
--
package mixIt;
$a=apple;
writes the value of $x with 'xyz'
print $x; #will print out xyz
How can I get the $x=abc here w/o passing as an arg?
there is no way to get 'abc' at this point.
}
you need to undersant how Perl differeniate and handle local and global
variable:
#!/usr/bin/perl -w
use strict
Never mind, I figured it out by put add the $ infront like:
print $mystuff::a;
print $mystuff::b;
Hope this help any newbies getting into package.
-rkl
Can a calling program reference a package variable?
It's not working for me.
test.pl
---
use fruit;
#I want to use this like a
Any diff between MYPKG::hello(); and MYPKG-hello(); ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Can someone make this work like I want? I'm trying to create a package
USER and reference/change it. The only thing I'm able to do is to call the
sub prtAll. I just want a structure that I can pass around in perl.
test.pl
---
use USER;
#this does NOT work
#how do i reference these vars
USER
UserInfo.pm
---
#!/usr/bin/perl
package UserInfo;
sub new
{ my $class = shift;
my $self = { fname, lname };
return bless $self, $class;
}
sub full_name
{ my $self = shift;
return $self-{fname} . ' ' . $self-{lname};
}
1;
On Tuesday, September 30, 2003, at 06:01 PM, [EMAIL
UserInfo.pm
---
#!/usr/bin/perl
package UserInfo;
sub new
{ my $class = shift;
my $self = { fname, lname };
return bless $self, $class;
}
sub full_name
{ my $self = shift;
return $self-{fname} . ' ' . $self-{lname};
}
1;
On Tuesday, September 30, 2003, at 06:01 PM, [EMAIL
) = Bingham;
#change name
$ui-(fname) = robert;
print ui: [ . $ui-full_name() . ]\n;
exit
UserInfo.pm
---
#!/usr/bin/perl
package UserInfo;
sub new
{ my $class = shift;
my $self = { fname, lname };
return bless $self, $class;
}
sub full_name
{ my $self = shift
strict subs in use at utest line 12.
Execution of test.pl aborted due to compilation errors.
test.pl
---
#!/usr/bin/perl
use strict;
use UserInfo;
my $ui = new UserInfo();
$ui-(fname) = bob; #dying here on assignment
$ui-(lname) = Bingham;
#change name
$ui-(fname) = robert;
print ui
and constructor?
#!/usr/bin/perl
package UserInfo;
use strict;
#our $fname,$lname;
#our $age, $sex; #if yes, how do you ref this from calling prog
sub new
{ my $class = shift;
my $self = { fname='', lname='' };
return bless $self, $class;
}
sub full_name
{ my $self = shift;
return $self
Ok - I got it finally.
I've used the use strict; in my progs. You're right. it helps to identify
loosely hanging vars that'll get ya.
Thanks, I'm getting a hang of it slowly, frustratingly but surely. I'm
just touching onto this perl class object thing but it seems pretty
interesting. I'm trying
Is it really bad practice oneway or another with calling sub?
doMe;
doMe();
doMe;
doMe();
Please explain in terms of performance and practice.
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Here's an excerpt about the from orielly and what the heck does it means:
...If a subroutine is called using the form, the argument list is
optional. if ommitted, no @_ array is setup for the routine; the @_ array
at the time of the call is visible to subroutine instead.
So, is there a better
you tried it?
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I wan to write a sub return true or false if the var was initialized.
Can someone correct this sub or is it good?
...
if(isNULL($x) { print it is null\n);
else { print it is NOT null\n);
...
sub isNULL
{
return $_[0] =~ //
}
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL
:
...If a subroutine is called using the form, the argument list is
optional. if ommitted, no @_ array is setup for the routine;
the @_ array at the time of the call is visible to subroutine instead.
If in doubt, run a test ;-)
#!/usr/bin/perl -w
use strict;
sub showargs {
print arguments
if ( ! defined $x )
I read up on defined and undefined. But I'm looking for a test that will
this return true or false to a var condition:
...
sub isNULL
{
return undefined $_[0] $_[0] eq '' $_[0] eq ;
}
# my goal is all three return the same as
# my proposed sub isNULL()
my $x; #
for the routine;
the @_ array at the time of the call is visible to subroutine instead.
If in doubt, run a test ;-)
#!/usr/bin/perl -w
use strict;
sub showargs {
print arguments are: . join(', ', @_) . \n;
}
sub test {
print Arguments for test() are: . join(', ', @_) . \n
All this is in the same paragraph of oreilly Programming perl page 100 -
pub in 1991. I guess it is kinda old. Anyway, it actually says ...more
efficient...
But I'm still sticking with showarg(); style too.
-rkl
But Orielly says showargs() is slower than showargs
That's a good point
Are you saying this would do everything that I want?
#I'm considering undefined var and '' and 0s are the same thing.
if($x) ... true - do_something
-rkl
On Thursday, October 2, 2003, at 05:09 PM, [EMAIL PROTECTED] wrote:
if ( ! defined $x )
I read up on defined and undefined. But I'm
you mean $x=0; would be false?
On Thursday, October 2, 2003, at 06:29 PM, [EMAIL PROTECTED] wrote:
Are you saying this would do everything that I want?
#I'm considering undefined var and '' and 0s are the same thing.
if($x) ... true - do_something
I said it would, if you don't mind 0
James has my intention correctly:
my $x=0;
if($x) #this would return false which is NOT I was looking for.
To recap, I want to test if a var is undefined or ''.
Thus, this would be equivalent to my isNULL() approach?
if(undefined $x length($x)==0)
thanks,
-rkl
-Original Message-
)
There IS no 'undefined' function in Perl, and you don't want to use ,
you'd want to use ||, since the empty string IS defined.
if (not defined($x) or length($x) == 0) {
# it's undef OR
}
Or, do it the other way:
if (defined $x and length $x) {
# it's NOT undef, and it's
unless understood, how about this.
if (defined $x and length $x)
So, is this the opposite?
if (! defined $x and ! length $x)
-rkl
On Thu, Oct 02, 2003 at 07:03:02PM -0700, [EMAIL PROTECTED] wrote:
if (defined $x and length $x)
So, is this the opposite?
if (! defined $x and length $x)
I'm trying to validate if a string contains \w and required atleas one
period (.)
This one check but does not require a period. Can someone change it please?
sub isValidDomain { return shift =~ /^[\w\.]{3,}$/ }
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
I can't seem to get this script working. I just want a simple code so I
can send mail that can change the reply address. I could get the command
line /bin/mail working with a system(/bin/mail...); but I could not
change the From so it doesn't say [EMAIL PROTECTED] I don't want to open
socket and
I need to send a mail from the cgi. It must be able to have a reply or
sender as someone different from the local web owner (apache). My
configuration:
redhat 9/qmail/vpopmail
The example below will be typically what I want:
To: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Subject: hello support
I'm just trying to send mail from a programming script NOT a real client.
For example, a monitor script calculating the disk storage and sending a
report/alert via the perl program.
I really don't want to add more library or module than necessary. So if
you guys can detect something wrong
Can I do something like this?
from
$sth = getVUser($dbh, $u, $d);
return $sth-rows();
to
return (getVUser($dbh,$u,$d))-rows();
a move from java-perl ;)
thanks,
-rkl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks, you did good with this code for me. I did not want to load more
library as most suggested. This works just fine with only one exception. I
needed to use the -t option. Here is the revised version which worked for
me:
#/usr/bin/perl
use strict;
use warnings;
my $mailprog = '/usr/sbin
1 - What is the best char to use in a file template?
Also, please give me a good regex?
I will have a formatted html page with some keys that I want to replace.
For example,
...
!-- here my token is a ! --
tdFirst Name:/tdtd!fname!/td
tdLast Name:/tdtd~!lname!/td
...
2 - Can I read in the
my $return = do_wrap('hello');
Doesn't this have to be MyCommon::do_wrap('hello'); ?
When running it, the error: Undefined subroutine main::do_wrap
thanks,
-rkl
[EMAIL PROTECTED] wrote:
How can I reuse a subroutine?
My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.99_07-5
not have to prepend the package name when Exporter is properly
invoked. That proper invocation can be a bit tricky, though. That is why
it
sat for a few days, while I worked on other projects.
When running it, the error: Undefined subroutine main::do_wrap
thanks,
-rkl
What Perl version
Can someone offers some recommendation into using dates?
I will be referencing year, month,day,hour,min,sec. I will also need to
increment or decrement by hours, days, months and years.
thanks,
-rkl
-
eMail solutions by
http://www.swanmail.com
--
To
How do I pass a null variable as an argument? Sometime I may want a
wrapper sub as below:
Example,
...
sub procName
{ my $fname = $_[0];
my $lname = $_[1]];
}
my procByLastName{ mySubA(null, doe); }
...
This is the error message:
Bareword null not allowed while strict subs in use
thanks,
thanks. it works!
-rkl
Try 'undef'.
eg. my procByLastName{ mySubA(undef, doe); }
On Fri, 2003-10-10 at 16:39, [EMAIL PROTECTED] wrote:
How do I pass a null variable as an argument? Sometime I may want a
wrapper sub as below:
Example,
...
sub procName
{ my $fname = $_[0];
my $lname
here's the rules:
starts with alphanumeric
4 chars long
require one period
/^[a-zA-Z][\w\-\.]{3,}$/
I think my regex is not doing the required period.
thanks,
-rkl
-
eMail solutions by
http://www.swanmail.com
--
To unsubscribe, e-mail: [EMAIL
This is not working as I expected:
if(validate('abc.com'))
{ print true; }
else
{ print false; }
-rkl
On Fri, Oct 10, 2003 at 12:49:51AM -0700, [EMAIL PROTECTED] wrote:
I couldn't get it to work.
Whoops --
sub validate {
local $_ = shift;
return( length == 4 and
Good info.
thanks,
-rkl
Hi,
[EMAIL PROTECTED] wrote:
How do I pass a null variable as an argument? Sometime I may want a
wrapper sub as below:
Example,
...
sub procName
{ my $fname = $_[0];
my $lname = $_[1]];
}
Alternatively, you could write either
my $fname = shift;
my
/^[a-zA-Z][\w\-\.]{3,}$/ /\./
The above matches more than 1 period.
I MUST have 1 and ONLY 1 period. Also, can I
fit it on one line?
this doesn't work either
sub isValidDomain
{ return shift =~ /^[a-zA-Z0-9][\w\-\.]{3,}$/ }
thanks
---
How about something like:
Does declaring at the top or the bottom matter?
thanks
-
eMail solutions by
http://www.swanmail.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Ok - I got it to work by changing the line to length = 3
If I could push the rule a little further, a new rule added is that an
alpha char a-Z MUST be after the period.
thanks
On Fri, Oct 10, 2003 at 03:11:52PM -0700, [EMAIL PROTECTED] wrote:
This is not working as I expected:
rules:
starts with alphanumeric
3 chars long
require ONLY one period
require alpha after the period
/^[a-zA-Z0-9][\w-].[a-zA-z]/ #but now working
sub validate {
local $_ = shift;
return( length = 3 and
tr/.// == 1 and
/^[[:alpha:]]/ and
The regex below is working for after the period. The part in fron is not
working. It is requiring atleast 2 chars before the period which is not my
rule. the rule for the front part:
start with [a-zA-Z0-9]
chars following is [\w-] BUT IS OPTIONAL
/^[a-zA-Z0-9][\w-]\.[a-zA-z]+$/
I think the
The regex below is working for after the period. The part in fron is not
working. It is requiring atleast 2 chars before the period which is not my
rule. the rule for the front part:
start with [a-zA-Z0-9]
chars following is [\w-] BUT IS OPTIONAL
/^[a-zA-Z0-9][\w-]\.[a-zA-z]+$/
I think the
1 - 100 of 730 matches
Mail list logo