John,
I would like to know if i understood this line clear.
while (1) {print $e[ ($i %= @e)++ ], "\b";}
so modulo's values are 0 then 1 then 2 then 0 (tehn loops back again).
This will make it loop and print the 4 values of my array.
is this applicable for all arrays with unlimited nu
Well I use the AUTOLOAD when Such a thing is required
write a single function
sub AUTOLOAD {
my $self = shift;
my ($parameter)=shift;
my ($value)=shift;
$self->{$parameter} = $value if($value);
return $self->{$parameter};
}
Now U can use $obj->CNAME("ABC");
But we warned
> Nix Juban wrote:
>
> Hi!
Hello,
> Im just new to PERL and im trying this out...its suppose to make this
> line tumble like a cartwheel.
>
> ##!/usr/intel/bin/perl -w
> use strict;
> use warnings;
>
> my @e=qw(|\_/);
> while (1)
> {
> foreach (@e)
> {
> print $_."\b";
> }
> }
#!/usr/int
Title: Message
Hi
all,
I am
using Perl 5.6.1 and Windows 2000 US English OS. I am developing some perl
scripts that have to process Japanese characters and print out Japanese
characters. We use to save the files in Unicode when it has some Japanese
characters. But when we compile it or exe
Thank you Wiggins,
and thankyou also for your help with scoping yesterday.
Colin
-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 13:08
To: Johnstone, Colin
Cc: '[EMAIL PROTECTED]'
Subject: Re: Passing an array to a subroutine
I
i want to insert this script in one of my programs appearing like its
processing or doing something..since my loop is while(1), meaning always
true, it will run forever until i halt it.
1)How do I time it to run for only few seconds?
2) What if im really processing something like extracting data
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 27, 2002 2:31 PM
> To: '[EMAIL PROTECTED]'
> Subject: Passing an array to a subroutine
>
>
> Hi all,
>
> I think somebody asked this the other day.
>
> How does one pass an array to
thanks, its now working..
lesson learned: to identify the items inside the list, have to separate it
using a space.
-nix
-Original Message-
From: Andres L. Figari [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 11:43 AM
To: Juban, Nix
Cc: [EMAIL PROTECTED]
Subject: Re: My s
If it is just an array and nothing else gets passed, then you can pass
it normally...
my $return = passArrayToMe(@array)
and your definition will go something like this:
sub passArrayToMe {
my @array = @_;
}
but if you need to pass other variables as well then you will need to
pass an array
#!/usr/bin/perl -w
use strict;
my @e=qw(| \ - /);
while (1)
{
foreach (@e)
{
print $_."\b";
}
}
you needed a space between each character or it thought it was one word :)
- Original Message -
From: "Juban, Nix" <[EMAIL PROTECTED]>
To: "'Andres L. Figari'" <[EMAIL P
Nope, it didnt work but thanks for responding.
it cancelled the \b, now it prints it.
\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\
_/\b
|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/
\b|\
_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|\_/\b|
Hi all,
I think somebody asked this the other day.
How does one pass an array to a subroutine please
Colin Johnstone
BlankI think that when you print "\" it thinks it is an escape character, so you would
need "\\" check these out, I always have to look them up :)
- Original Message -
From: Juban, Nix
To: '[EMAIL PROTECTED]'
Sent: Tuesday, November 26, 2002 7:19 PM
Subject: My script doesnt
Hi!
Im just new to PERL and im trying this
out...its suppose to make this line tumble like a cartwheel.
##!/usr/intel/bin/perl -wuse
strict;use warnings;
my @e=qw(|\_/);while
(1){ foreach (@e) { print
$_."\b"; }}
its just
printing, something like this:
_|\_|\_|\_|\_|\_|\_|\_|\_|\
Not to sound bashing, but i have to agree with Ramprasad.. Think about what
you're posting. Nobody like wild-goose chases.
Try checking $@ for an error along with $! if something is going on.
$!
$OS_ERROR
$ERRNO
If used in a numeric context, yields the current value of the errno variable,
id
Thanks Paul for the perl5005delta inforomation. That's some good information!
Chris
On Friday 22 November 2002 06:13 am, Paul Johnson wrote:
> Dr. Poo said:
> > This worked perfectly. Why the hell havn't i ever seen INIT before?
>
> You haven't read perl5005delta? INIT is still fairly
On Sat, Nov 23, 2002 at 07:46:57PM +0530, [EMAIL PROTECTED] wrote:
> Hi,
> > By now you will probably have worked out that this community is very
> > happy to help people of any ability to improve their Perl skills, but is
> > rather reluctant just to hand out ready-made solutions. This is as it
>
On Tue, Nov 26, 2002 at 04:40:14PM -0500, Fred Sahakian wrote:
> Hello,
>
> Im working a program and trying to get the pragma 'strict' to work. I
> cant define a variable though, Im stuck, any ideas?
>
> my $changeaddress = $FORM{'changeaddress'};
>
>
> I keep getting an error on the $FORM
>
Actually it is not,
a bit higher up when I parse the data I have a line that reads:
$FORM{name} = $value;
Ive tried to fix it here as well but Ive had no luck, Im also getting
into the problem with $value as well.
thanks!
>>> "Mark Anderson" <[EMAIL PROTECTED]> 11/26/02 04:52PM >>>
Is th
--- Nicole Seitz <[EMAIL PROTECTED]> wrote:
> Hi there!
>
> I've just started to learn OOP with Perl.With the help of perltoot I wrote a
> class Person and some methods(see below).
'perltoot' is great, but there are a few things that can be done differently.
Admittedly, it's
aimed at beginners
On Wed, Nov 27, 2002 at 12:12:46AM +, Nicole Seitz wrote:
> Hi there!
>
> I've just started to learn OOP with Perl.With the help of perltoot I wrote a
> class Person and some methods(see below).
>
> package Person;
[ snip implementation ]
> To store some data in my object I did the follwi
Hello,
Im working a program and trying to get the pragma 'strict' to work. I
cant define a variable though, Im stuck, any ideas?
my $changeaddress = $FORM{'changeaddress'};
I keep getting an error on the $FORM
Using "my $FORM{'changeaddress'}" doesnt work.
what is the correct way to handle
Hi there!
I've just started to learn OOP with Perl.With the help of perltoot I wrote a
class Person and some methods(see below).
package Person;
use strict;
sub new {
my $self = {};
my $proto = shift;
my $class = ref($proto) || $proto;
$self->{CNAME} = undef;
$self
Mystik Gotan wrote:
> No. Use warnings is a module, the -w flag is just some extra for error
> trapping (which sometimes really is useful!). But it's alright using both
> (along with strict, ofcourse). So -w is a built in 'function' and
> warnings.pm is just a module.
>
> (BTW, using the -T flag
Oops, Meng pointed out that the print method is inherited from Mail::Internet
where of course it is documented. I suggested instead that the inheritance be
documented a bit more clearly.
--
Peter Scott
http://www.perldebugged.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
what do you want to get?
do you get the size of the network? if yes from there you can make your own
fonction to build the netmask.
From: Marija Silajev <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Net::Netmask problem
Date: Mon, 25 Nov 2002 13:16:35 +0100
Hi,
I have the following pr
On Nov 26, Michael J Alexander said:
> Can someone tell me why this simple bit of code doesn't work? The
>"If" statement prints even when it's false.
>
>$x = 20;
>$y = 15.5;
>$z = .05;
>$a = $x+$y;
>
>print "a equals $a.\n";
>
>if ($a = 20) {print "a is equal to 20.\n";}
No one has told y
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Mystik Gotan) writes:
>What do you mean with piece? I know you're way better than me, but why don't
>write your pieces (in which case I think output) to STDOUT.
>
>Like:
>@array = ('piece', 'of', 'you');
>print STDOUT, @array;
>
>Don't think this
($a = 20) is an assignment so the if statement is testing the success of the
(Bassignment, not a comparison - not what you want here.
(B
(BChange it to ($a == 20), this will test numerically whether $a contains 20.
(Beq can be used for string comparisons
(B
(B
(BJim
(B
(B-Original M
> if ($a = 20) {print "a is equal to 20.\n";}
Actually, it is always going to be true. '=' is the assignment
operator, so $a is being set to 20 and '$a = 20' will always evaluate to 20
-- which is considered true. You need '==':
if ($a == 20) {print "a is equal to 20.\n";}
---Lar
It should be
if ($a == 20) < instead of $a = 20 ( This is assignment instead
of comparison)
{
} else{
}
-Original Message-
From: Michael J Alexander [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 10:19 AM
To: Perl List
Su
You should be using syntax like:
if ( $a == 20 ) { print ... }
When you say:
if ( $a = 20 ) { ... }
you are actually assigning the value 20 to $a. Which was successful, hence
the if statement is evalutated to 'true'.
Regards,
Joshua Colson
Systems Administrator
Giant Industries, Inc.
P
Hello,
This is my first message in this perl list. I'm new in Perl programming and
I need some help.
I need to use Perl in a SCO Openserver 5.05 machine to validate XML
messages. To do this I know that it exists the Xerces library. The machine
has Apache 1.3.26 installed.
The Xerces library need
Mike Here
Can
someone tell me why this simple bit of code doesn't work? The
"If" statement prints even when it's false.
$x = 20;
$y = 15.5;
$z = .05;
$a = $x+$y;
print "a equals $a.\n";
if ($a = 20) {print "a is equal to 20.\n";}
else {print "a is not equal to 20.\n";}
---
Outgoing ma
Hi,
> I can't really figure out what the purpose of wantarray() is.
> Can someone please give me a good, decent explanation?
wantarray() returns true if the context of the actual subroutine
expects a list as return value(s).
sub do_something {
my $arg = shift;
do_something and stuff
On Tuesday, Nov 26, 2002, at 06:35 US/Pacific, Mystik Gotan wrote:
I can't really figure out what the purpose of wantarray() is.
Can someone please give me a good, decent explanation?
Thanks in advance :-)
my $scalar = funk(@args);
my @array = funk(@args);
if you use
return wantarray ? @a
Hyphenated names don't cut it in your world. Or names with attached
qualifiers like 'Jr.'. Or titles like ', M.D.'
So Pei Wu-Schlossnagle, PhD.
Chuck Tomasi wrote:
One of my cohorts pointed me in the right direction. I should have known
this from previous experience.
if ($st !~ /^[a-zA-Z
One of my cohorts pointed me in the right direction. I should have known
this from previous experience.
if ($st !~ /^[a-zA-Z \']+$/) {
print "$st: bad chars found\n";
} else {
print "$st: OK\n";
}
A simple "^" at the beginning and "$" at the end.
Thanks to all who assisted with
Well there is the obvious place to start (perldoc -f wantarray):
wantarray
Returns true if the context of the currently
executing subroutine is looking for a list value.
Returns false if the context is looking for a
scalar. Returns the unde
Mystik Gotan said:
> I can't really figure out what the purpose of wantarray() is.
> Can someone please give me a good, decent explanation?
C is the function which tells you in which context your
subroutine was called - void, scalar or list. This means, what will
happen to the data you return fr
Hmmm I'm not getting where I want to go. Consider the following code:
#!/usr/bin/perl -w
@a = ( "chuck",# Good
"chuck99", # bad - numbers in a name?
"chuck_5", # bad - numbers/underscore in a name
"chuck!3", # bad - symbols?
"chuck t",
I can't really figure out what the purpose of wantarray() is.
Can someone please give me a good, decent explanation?
Thanks in advance :-)
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
___
>> On 26 Nov 2002 09:57:44, Dylan Boudreau <[EMAIL PROTECTED]> said:
> Is use warnings; the same as #!/usr/bin/perl -w
Good question. They're similar, but 'use warnings':
- only works under Perl 5.6+
- works _lexically_, rather than globally
- this means that you can do this:
pack
That's essentially correct. If you remove a symlink, you remove a
shortcut and the original file still exists.
If you remove what a symlink points to and the symlink is left intact, it
is an invalid link. The data is gone and if you reference the symlink
you'll get an error.
Regular (hard) link
see embedded lines
Satya Devarakonda wrote:
I am sorry. This is how I used the FTP related code. But when "server"
refuses connection it doesn't die.
use Net::FTP;
eval {
my $ftp ="\0";
No need my $ftp is enough;
$ftp = Net::FTP->new( "server" , Debug => 0);
catch the
No. Use warnings is a module, the -w flag is just some extra for error
trapping (which sometimes really is useful!). But it's alright using both
(along with strict, ofcourse). So -w is a built in 'function' and
warnings.pm is just a module.
(BTW, using the -T flag for Taint Checking can also pr
No.
use warnings is file scoped. -w is 'executable' scoped. In other words any modules
that you 'use' will inherit the -w but not the 'use'.
At least that is my understanding from the Camel. And appears to be the case from what
I have seen in action.
http://danconia.org
--
From: "Paul Johnson" <[EMAIL PROTECTED]>
> walter valenti said:
>
> > How is possible launch an exception in perl ???
>
> die !!!
Are you gonna slay him Paul? ;-)
perldoc -f die
perldoc -f eval
> > --
> > God hates us all
>
> Unlikely, I think.
Yeah,
There is a person P, suc
Is
use warnings;
the same as
#!/usr/bin/perl -w
Dylan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> Why not go with /[\w ]+/
> \s contains more than just a ' ' and I don't know if an apostrophe in a name
> is really valid or not.
> Rather, I think the earlier suggestion of /[\w ]{,20}/ might be better so you
> can limit the string length to only the first 20 characters.
> Similarly, I would l
An excellent article about your problem:
http://perl.plover.com/FAQs/Namespaces.html
You should be doing:
use strict;
use warnings;
This will produce somewhat cryptic messages until you get used to it but then it will
save you lots of time...
http://danconia.org
-
man ln
That describes how links are created command line, which gives a good overview of what
a link is, the same applies to perl.
http://danconia.org
On Tue, 26 Nov 2002 12:00:00 +0530, Ramprasad A Padmanabhan
<[EMAIL PROTECTED]> wrote:
> th
What do you mean with piece? I know you're way better than me, but why don't
write your pieces (in which case I think output) to STDOUT.
Like:
@array = ('piece', 'of', 'you');
print STDOUT, @array;
Don't think this really helps you, maybe others do :)
--
Bob Erinkveld (Webmaster Ins
Jerry
You appear to be using Win32::GUI or something similar?
You need to provide more information about your application for us to
understand your problem, but it may be useful to point out that a dropdown
list will return exactly the information put into it. If you put trailing
spaces into your
Does anyone know how you can print a Mail::Audit piece of email to STDOUT?
--
The older I grow, the more I distrust the familiar doctrine that age
brings wisdom.
-- H.L. Mencken
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Chuck Tomasi wrote:
System Specs
Perl 5.6.1 (dev) 5.8.0 (prod)
Mac OS X 10.2.2 (dev) NetBSD 1.5.2 (prod)
MySQL 3.23.52
I'm writing a web form to accept user applications. Like most programs,
I'd like to keep the garbage characters out to limit hacking attempts.
I want to verify the
I am sorry. This is how I used the FTP related code. But when "server"
refuses connection it doesn't die.
use Net::FTP;
eval {
my $ftp ="\0";
$ftp = Net::FTP->new( "server" , Debug => 0);
$ftp->login("ftp1","pass");
$ftp->cwd("//dir1/datatrend/test");
$ftp->put("clmgxstime.txt
walter valenti said:
> How is possible launch an exception in perl ???
die !!!
> Thanks
You're welcome.
> --
> God hates us all
Unlikely, I think.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMA
Using the 'x' operator, you can use spaces in your matching pattern:
m/^[a-zA-Z]{0,20} [A-Za-z]{0,20}$/x
m/^[a-zA-Z]{0,20}\s [A-Za-z]{0,20}$/
Ofcourse, the +,?,* and so on could be used also for determing the character
count.
m/^\'$/
Maybe this helps you.
Cheers
--
Bob Erinkveld (W
System Specs
Perl 5.6.1 (dev) 5.8.0 (prod)
Mac OS X 10.2.2 (dev) NetBSD 1.5.2 (prod)
MySQL 3.23.52
I'm writing a web form to accept user applications. Like most programs,
I'd like to keep the garbage characters out to limit hacking attempts.
I want to verify the firstname and last na
On Mon, 25 Nov 2002 19:30:38 +0100, [EMAIL PROTECTED] (Nandita
Shenvi) wrote:
>I have checked the mailing list and some where in 1999 a person had a
>similar problem and i could not find any appropriate answer to the questions
>that he had.
>anyway, i will try to explain:
>I want to write a Per
How is possible launch an exception in perl ???
Thanks
--
God hates us all
Per favore non mandatemi allegati in Word o PowerPoint.
Si veda http://www.fsf.org/philosophy/no-word-attachments.html
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Johnstone, Colin said:
> Gidday all,
>
> I have written what I will refer to as an include file ( php speak ) and
> named it press_config.pl The contents is the initialisation of the
In Perl it would probably be called a library - hence the pl extension.
Perl Library.
> variables that I wish to
Hi,
I freshly installed RedHat 8.0, but I cant install your Device::SerialPort version
0.12. When I
run perl Makefile.PL, I got this error :
Finding ioctl methods ...
trying 'termios.ph'... nope
trying 'asm/termios.ph'... not useful
trying 'sys/termiox.ph'... nope
trying 'sys/term
perldoc -f do
José.
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 26, 2002 7:58 AM
> To: '[EMAIL PROTECTED]'
> Subject: Help perl gurus
>
>
> Gidday all,
>
> I have written what I will refer to as an include file ( php
> speak ) an
I can't seem to get this to work at all. Here's what I've done:
1) Downloaded the .PM file.
2) Created a NET directory under c:\perl\lib
2) Copied the LDAP.PM file to c:\perl\lib\Net
3) Created Convert directory under c:\perl\lib.
4) Copied the Convert::ASN1 file (ASN1.PM) to the c:\perl\lib\con
66 matches
Mail list logo