Steve Bertrand wrote:
[snipped due to excessive content]
...
[snip]
Tom was probably thinking of Unix, but same principles apply to other
platforms.
It's also worth noting that whatever application you're using to update
the database may well output something useful to STDOUT and it may be a
On Dec 13, 2007 1:02 AM, Steve Bertrand <[EMAIL PROTECTED]> wrote:
> Rob Dixon wrote:
> > Chas. Owens wrote:
> >>
> >> Only use the default variable with functions and operators that use
> >> it by default like chomp and regexes.
> >
> > What's this? The Gospel according to Chas?!
>
> Hey now...
>
Rob Dixon wrote:
> Chas. Owens wrote:
>>
>> Only use the default variable with functions and operators that use
>> it by default like chomp and regexes.
>
> What's this? The Gospel according to Chas?!
Hey now...
Take into consideration that this is not everyone's point of view.
Just because you
[snipped due to excessive content]
...
> [snip]
>
> Tom was probably thinking of Unix, but same principles apply to other
> platforms.
>
> It's also worth noting that whatever application you're using to update
> the database may well output something useful to STDOUT and it may be a
> simple st
Steve Bertrand wrote:
> Tom Phoenix wrote:
>>
[snip]
>>
I think you're looking for the program's exit status. Traditionally on
Unix and many similar systems, the exit status is an integer, with 0
meaning "normal exit" and anything else meaning that something went
wrong. That's the value that's
>> I am heavily modifying (re-writing) some Perl scripts that are bundled
>> within the dialup_admin web interface for FreeRADIUS.
>>
>> Eventually I'd like to bring the execution of a few system commands
>> (executing mysql binary and importing an SQL file into it) into Perl,
>> however, for now I
Chas. Owens wrote:
>
Only use the default variable with functions and operators that use
> it by default like chomp and regexes.
What's this? The Gospel according to Chas?!
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.or
Chas. Owens wrote:
>
On Dec 12, 2007 1:00 AM, jeff pang <[EMAIL PROTECTED]> wrote:
snip
You can add a "\n" (or "\r\n" on windows,etc) at the end of each
element in the array,like,
snip
In Perl, "\n" is not linefeed, it is the newline character. It
translates to the proper sequence of characte
[EMAIL PROTECTED] wrote:
>
I used the script Rob posted a few days with the list::util option and
it works. Thanks Rob!
However we also use systems we earlier versions of perl it seems. When
using the same script I find that it moans about Arrays being present
rather than an operator within the
On 12/12/07, Steve Bertrand <[EMAIL PROTECTED]> wrote:
> I am heavily modifying (re-writing) some Perl scripts that are bundled
> within the dialup_admin web interface for FreeRADIUS.
>
> Eventually I'd like to bring the execution of a few system commands
> (executing mysql binary and importing an
I want to install Apache::Scoreboard v0.15 (b/c I'm using mp1) from
cpan shell. But the current version is 2.08. How can I install the
specified version of a module from cpan shell? thanks.
Best Regards,
Jeff (joy) Peng
_
protoplasm schreef:
> foreach (keys %opts_hash)
> {
> if ( !defined $opts_hash{$_} )
> {
> next;
> }
> elsif ( $opts_hash{$_} == 1 )
> {
> print "$_ = $opts_hash{$_}\n";
> }
> }
An alternative way to write that:
for (sort keys %opts_hash) {
next unless defined $opts_hash
John W . Krahn schreef:
> Dr.Ruud:
>> my $filename = "test.db";
>> open my $fd, "<", $filename
>> or die "'$filename': $!";
>>
>> (yes, I prefer Texan quotes nowadays :)
>
> Is that Dutch slang? I have never heard that expression before.
I paraphrased on a recent discussion in p6lang.
I am heavily modifying (re-writing) some Perl scripts that are bundled
within the dialup_admin web interface for FreeRADIUS.
Eventually I'd like to bring the execution of a few system commands
(executing mysql binary and importing an SQL file into it) into Perl,
however, for now I just need it to
yitzle wrote:
sub timestamp { my $t = localtime; return \$t; }
This function stores the localtime (seconds since epoch?) in a
variable $t
No, seconds since epoch is not what localtime() returns and what's
stored in $t.
perldoc -f localtime
--
Gunnar Hjalmarsson
Email: http://www.gunnar
On 12/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm trying to create a regex to ensure a minimum password length.
It would seem that you should use the length function. (Also, why
should it matter that the string in question is a password?)
> I'm trying this:
>
> $regex= '^.{4,}$'
M
On 12/12/07, Henrik Nielsen <[EMAIL PROTECTED]> wrote:
> Whats with the \$t in this sub?
> sub timestamp { my $t = localtime; \$t }
>
> And what does this do?
> sub timestamp { my $t = localtime; }
The localtime function is documented in the perlfunc manpage. It's
being used here in a scalar cont
In perl, the last variable in a function is returned.
sub timestamp { my $t = localtime; \$t }
is the same as
sub timestamp { my $t = localtime; return \$t; }
This function stores the localtime (seconds since epoch?) in a
variable $t, then returns a reference to $t.
--
To unsubscribe, e-mail
Hi
Whats with the \$t in this sub?
sub timestamp { my $t = localtime; \$t }
And what does this do?
sub timestamp { my $t = localtime; }
Henrik
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Thanks for the advice. After I posted I tried this and it worked too:
foreach (keys %opts_hash)
{
# This next line of code eliminates the "Use of uninitialized value
in
# numeric eq (==)" error when 'use warnings;' is enabled.
if ( !defined $opts_hash{$_} )
{
You just want the length of a string?
$size = length $input;
or
if ( length $input > $minSize ) {
...
} else {
...
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi all,
I'm trying to create a regex to ensure a minimum password length.
I'm trying this:
$regex= '^.{4,}$'
That work fine exept for, at least, the equal signal (=)
For example, if i try 'my=test", it returns false. If i try 'myte=st',
that works.
If i change 4 for 2 in regex, then the first
On Dec 12, 2007 12:52 PM, Chas. Owens <[EMAIL PROTECTED]> wrote:
> On Dec 12, 2007 12:26 PM, <[EMAIL PROTECTED]> wrote:
> > Paul Johnson <[EMAIL PROTECTED]> writes:
> snip
> > > It certainly would. And if you find any which don't, and the reason
> > > can't be tracked back to a problem in your co
On Dec 12, 2007 12:26 PM, <[EMAIL PROTECTED]> wrote:
> Paul Johnson <[EMAIL PROTECTED]> writes:
snip
> > It certainly would. And if you find any which don't, and the reason
> > can't be tracked back to a problem in your code (or perhaps even if it
> > can), please use the perlbug utility to repor
Paul Johnson <[EMAIL PROTECTED]> writes:
[...]
> This would be absolutely wonderful test material for the new release!
>
>> It will be interesting to see if they all still work.
>
> It certainly would. And if you find any which don't, and the reason
> can't be tracked back to a problem in your
On Wednesday 12 December 2007 07:15, Jenda Krynicky wrote:
> From: jeff pang <[EMAIL PROTECTED]>
>
> > --- "Sayed, Irfan (Irfan)" <[EMAIL PROTECTED]> wrote:
> > > My query is that can i store the output of this for loop in
> > > variable or
> > > list. so that if i print the content of that variabl
On Tuesday 11 December 2007 16:53, protoplasm wrote:
>
> I'm messing around with Getopt and have a set of arguments that can
> be passed to the program. I am new to perl and am unaware of how to
> resolve the error while keeping 'use warnings;' enabled. Any help
> would be greatly appreciated.
>
>
On Dec 12, 2007 10:11 AM, Roman Daszczyszak <[EMAIL PROTECTED]> wrote:
> Oops.. I made one mistake in my explanation. The structure in
> question is a hash of usernames each containing another hash of the
> user attributes. I'm trying to use the code to ignore an attribute in
> the second-level h
From: jeff pang <[EMAIL PROTECTED]>
> --- "Sayed, Irfan (Irfan)" <[EMAIL PROTECTED]> wrote:
> >
> > My query is that can i store the output of this for loop in
> > variable or
> > list. so that if i print the content of that variable or array then
> > it
> > should print as
> >
> > dadsad
> > as
Oops.. I made one mistake in my explanation. The structure in
question is a hash of usernames each containing another hash of the
user attributes. I'm trying to use the code to ignore an attribute in
the second-level hash.
Will that work?
On Dec 12, 2007 3:49 PM, Roman Daszczyszak <[EMAIL PROTE
On Dec 12, 2007 9:49 AM, Roman Daszczyszak <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am trying to utilize Data::Compare to compare two data structures
> containing user names and account attributes from Windows XP systems.
> Using Win32API::Net, it returns an array of usernames, which can be
> loo
On Dec 11, 2007 7:53 PM, protoplasm <[EMAIL PROTECTED]> wrote:
snip
> my $opts_hash;
> my %opts_hash = ();
snip
You don't need $opts_hash (you aren't using it). You can get rid of
the undef warnings by making sure that the keys in %opts_hash are used
like this:
#default values for the options
my
Hi all,
I am trying to utilize Data::Compare to compare two data structures
containing user names and account attributes from Windows XP systems.
Using Win32API::Net, it returns an array of usernames, which can be
looped through to pull a hash of each users' attributes. However,
comparing these h
I'm messing around with Getopt and have a set of arguments that can be
passed to the program. I am new to perl and am unaware of how to
resolve the error while keeping 'use warnings;' enabled. Any help
would be greatly appreciated.
Code:
==
#!/opt/local
On Dec 12, 2007 8:46 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
> On Wednesday 12 December 2007 04:03, Dr.Ruud wrote:
snip
> > or die "'$filename': $!";
> >
> > (yes, I prefer Texan quotes nowadays :)
>
> Is that Dutch slang? I have never heard that expression before.
>
snip
Some people c
On Wednesday 12 December 2007 04:03, Dr.Ruud wrote:
> jeff pang schreef:
> > open FD,"test.db" or die $!;
>
> Jeff, could you please start using lexical filehandles, more
> whitespace, and 3-argument opens, when publishing example code on
> this list?
>
> my $filename = "test.db";
> open my $fd
On Dec 12, 2007 8:12 AM, jeff pang <[EMAIL PROTECTED]> wrote:
>
> --- "Chas. Owens" <[EMAIL PROTECTED]> wrote:
> > The only reason to use any version earlier than 5.6.3
> > is
> > that your sysadmins won't upgrade an ancient box (and even then it
> > is
> > time to quit that job because if they are
Hello,
I have searched on cpan.org but I couldn't find what I need. Do you know if
there is a perl module that can create questionnaires for polls?
I would like to use a module that could create questionnaires with more
questions, that can split them in more pages (like a wizard) as I specify
--- "Chas. Owens" <[EMAIL PROTECTED]> wrote:
> The only reason to use any version earlier than 5.6.3
> is
> that your sysadmins won't upgrade an ancient box (and even then it
> is
> time to quit that job because if they are that stupid then there
> are
> probably other issues as well).
>
mhh? if
On Dec 12, 2007 7:30 AM, jeff pang <[EMAIL PROTECTED]> wrote:
snip
> I'd like. But I learned perl from 2002 year, I even don't know what's
> perl 4.
snip
Some features you would have to stop using:
* lexical variables (i.e. my)
* multidimensional arrays and nested hashes
* real (vs symbolic) refer
On Dec 12, 2007 5:42 AM, <[EMAIL PROTECTED]> wrote:
> All,
>
> Thanks for your assistance in helping me with my issues.
>
> The script posted by Rob on the 7th works fantastic.
>
> However I've discovered that we have a lot of systems out there
> running a previous version of perl, so much so that
--- "Chas. Owens" <[EMAIL PROTECTED]> wrote:
> Failing backwards
> compatibility
> with an ancient version of Perl is not a bad thing. Or do you also
> support Perl 4?
>
I'd like. But I learned perl from 2002 year, I even don't know what's
perl 4.
Best Regards,
Jeff (joy) Peng
__
On Dec 12, 2007 7:09 AM, jeff pang <[EMAIL PROTECTED]> wrote:
>
> --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote:
>
> > jeff pang schreef:
> >
> > > open FD,"test.db" or die $!;
> >
> > Jeff, could you please start using lexical filehandles, more
> > whitespace,
> > and 3-argument opens,
>
> Ok I can but
On Dec 12, 2007 7:08 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> "Chas. Owens" schreef:
snip
> > } #unless a reference was made to $fh it will close here
snip
> Your last comment line ("it will close here") I would put inside the
> block, or I would say "is closed with the block".
> (I am all for lexi
All,
Thanks for your assistance in helping me with my issues.
The script posted by Rob on the 7th works fantastic.
However I've discovered that we have a lot of systems out there
running a previous version of perl, so much so that I am getting
errors within the util.pm.
"Array found where opera
I used the script Rob posted a few days with the list::util option and
it works. Thanks Rob!
However we also use systems we earlier versions of perl it seems. When
using the same script I find that it moans about Arrays being present
rather than an operator within the util.pm script.
Do we use th
--- "Dr.Ruud" <[EMAIL PROTECTED]> wrote:
> jeff pang schreef:
>
> > open FD,"test.db" or die $!;
>
> Jeff, could you please start using lexical filehandles, more
> whitespace,
> and 3-argument opens,
Ok I can but I don't like.
When I uploaded my cpan module with a lexical FH and 3 args open,
"Chas. Owens" schreef:
> Dr.Ruud:
>> Chas. Owens:
>>> (you should close file handles once you
>>> stop using them because they are a limited resource).
>>
>> I often start a new block at opening a file.
>
> If you are using the new scalar based file handles this is a good
> practice since they aut
On Dec 11, 2007 7:33 PM, Why Tea <[EMAIL PROTECTED]> wrote:
> my $s = "This is a string\nThis is line 2\n";
> print $s;
>
> The "\n" is interpreted as newline in the code above. But if the
> string (i.e. $s) is in a file, it will be printed literally as "\n" -
> how do I get Perl to treat it as new
jeff pang schreef:
> open FD,"test.db" or die $!;
Jeff, could you please start using lexical filehandles, more whitespace,
and 3-argument opens, when publishing example code on this list?
my $filename = "test.db";
open my $fd, "<", $filename
or die "'$filename': $!";
(yes, I prefer Te
my $s = "This is a string\nThis is line 2\n";
print $s;
The "\n" is interpreted as newline in the code above. But if the
string (i.e. $s) is in a file, it will be printed literally as "\n" -
how do I get Perl to treat it as newline?
/Why Tea
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
On Dec 12, 2007 4:46 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> "Chas. Owens" schreef:
>
> > (you should close file handles once you
> > stop using them because they are a limited resource).
>
> I often start a new block at opening a file.
snip
If you are using the new scalar based file handles this
On Dec 11, 2007 6:26 PM, Why Tea <[EMAIL PROTECTED]> wrote:
> I have a text file of acronyms of about 2MB, I would like to write a
> cgi script to allow users to query for any acronym in the text file.
> What is the best way of implementing it (i.e. taking the acronym as a
> key to search for the e
On Dec 12, 2007 12:04 AM, Sayed, Irfan (Irfan) <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have some string stored in array as follows.
>
> @array=(dadsad,assasd) Now if i print this array then it is printing as
> dadsad,assasd
I certainly hope you are not using barewords like this. This will
work
--- Why Tea <[EMAIL PROTECTED]> wrote:
> I have a text file of acronyms of about 2MB, I would like to write
> a
> cgi script to allow users to query for any acronym in the text
> file.
> What is the best way of implementing it (i.e. taking the acronym as
> a
> key to search for the expanded text)
On Dec 12, 2007 1:00 AM, jeff pang <[EMAIL PROTECTED]> wrote:
snip
> You can add a "\n" (or "\r\n" on windows,etc) at the end of each
> element in the array,like,
snip
In Perl, "\n" is not linefeed, it is the newline character. It
translates to the proper sequence of characters on each operating
Irfan, this will work:
#!/opt/local/bin/perl
use warnings;
use strict;
my @output = ("dadsad", "assasd");
foreach (@output)
{
print "$_\n";
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
I have a text file of acronyms of about 2MB, I would like to write a
cgi script to allow users to query for any acronym in the text file.
What is the best way of implementing it (i.e. taking the acronym as a
key to search for the expanded text)?
/Why Tea
--
To unsubscribe, e-mail: [EMAIL PROTEC
"Chas. Owens" schreef:
> (you should close file handles once you
> stop using them because they are a limited resource).
I often start a new block at opening a file.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
[EMAIL PROTECTED] schreef:
*PLONK*
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 12/12/2007, Auxence Sima <[EMAIL PROTECTED]> wrote:
>
> Hi everyone.
> I d like to have u guys input about my code. Im writing a perl script
> that would generate some primers. my input file calles " output.txt ) was
> generated from primer3.
> if u guys can take a look at my script and tell
61 matches
Mail list logo