Jayakumar Rajagopal wrote:
($a=3 && $b=6 ) if ( 1 == 1 );
print " $a $b \n";
Output : 6 6
This is a precedence problem; the "&&" binds more tightly
than the "=" on its left. B::Deparse eliminates some of
the constant expressions, but you can see the result:
% perl -MO=Deparse,-p -e '$a=
Jayakumar Rajagopal wrote:
in regexp, I feel \s and \b behaves same.
\s matches whitespace. \b matches a "word boundary", which is
the border between a word character and a non-word character.
These are never the same, since \s matches a character, and \b
matches *between* characters...
% perl
[EMAIL PROTECTED] wrote:
defined (my $pid = fork) or die "Cannot fork process : $!";
unless ($pid){
exec "$Command";
die "Cannot exec : $Command : $!";
waitpid($pid,0);
}
The waitpid() is unreachable there. Try putting it outside the
unless() block, so that the parent will execute
Timothy Donahue wrote:
I have a program that I am writing that I need to accept input from
either STDIN (for file redirections or pipes) or from the command-line.
The program manipulates email addresses for our mail servers, so I
should have the option to do either 'email_add
[EMAIL PROTECTED]' or
Dan Muey wrote:
Any thoughts?
Erm, it looks okay. Maybe if you showed a complete example and the error
or warnings (or misbehavior) somebody would see the problem.
Here's what I was using.
BEGIN {
package Foo;
use base qw(Exporter);
use strict;
our @EXPORT_OK =
Dan Muey wrote:
I tried both and no go. All is well (IE the thigns specified
are Exported to the script) if I do not have strict->import; (Which makes
the script act as if they had 'use strict;' in the script)
Did you "use strict" or "require strict" anywhere?
--
Steve
--
To unsubscribe, e-mail:
Dan Muey wrote:
sub import {
my $class = shift;
$class->SUPER::import(@_);
strict->import;
}
I believe that will fix it. Not 100% sure though. Never
tried it. ;)
I just tried it and no go. Any other thoughts anyone?
The problem here is that Exporter::import() looks at th
Kipp, James wrote:
I want to split at each new line for the row, then split the row into
columns, and get rid of the "%" on the third column.
$str = "
/var 0.9950%
/usr 0.5871%
/tmp 0.49 1%
"
my @rows = map [split], sp
TeamSolCO wrote:
Now then, I've opened a can of worms by adding "use strict" and
> "use warnings" to the source. Keep in mind that this application
was running JUST FINE before doing this. I'm only trying to 'modernize'
this old code. Having started with a couple screen-fulls of resulting
> erro
Mallik wrote:
Can anybody explain the functionality of eval in brief?
There are two different flavors of eval().
The "string" version looks like this:
eval $code;
And it treats its argument as a string containing Perl source code,
which it compiles and executes.
The "block" version looks lik
Paul Kraus wrote:
Can I declare from this element to end with an array slice.
@arary[3...] but this doesn't work?.
You can refer to the last index with $#arary, so:
@arary[3 .. $#arary];
Is that what you meant?
--
Steve
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-m
Charles Lu wrote:
If I want to randomly generate a dice (4 side) roll, I can use the
following expression:
$roll = 1 + int( rand(4));
This assumes that every side of this dice has equal chance of being
rolled (0.25). Thats easy. Now What if I say, that the probability of
rolling a 3 is 70
rmck wrote:
But I run this system call and it took allnight to run :(
You were asking perl to rewrite the whole file for every line
you wanted to change.
#!/usr/bin/perl
use strict;
use warnings;# or just use Foo::Monkey :-)
use POSIX qw(strftime);
die "Usage: $0 FILES\n
On Tuesday, January 20, 2004, at 11:34 PM, Robin Sheat wrote:
Hey there, I'm not a total beginner to Perl, but am far enough into it
to have a lot of questions, so I hope this is a suitable place for them
:)
Fire away!
sub getResponse {
my $self = shift;
my $incoming = <$self->{filehandle}
Trina Espinoza wrote:
I would like to know how I would say if $item equals $tempitem OR
if $item is empty(the variable is a placeholder that has nothing in
it), execute command.
Usually "empty" means "undefined", and if that's what you mean, you
could check like this:
if ((not defined $item)
On Saturday, January 17, 2004, at 06:21 PM, Dan Muey wrote:
I was curious if it's possible to have a module like so:
package Foo:Monkey;
use strict;
use warnings;
You can call "strict->import" like this:
package Foo::Monkey;
sub import {
for my $pragma (qw(strict warnings)) {
On Jan 7, 2004, at 2:57 PM, drieux wrote:
But simply because there is no controlling
terminal does NOT mean that there is nothing on STDIN.
Were you reading that code backwards?
die usage() if @ARGV == 0 and -t;
# if ((THERE ARE NO FILENAMES IN ARGV) &&
# (STDIN IS HOOKED UP TO A TERMIN
On Jan 7, 2004, at 1:10 PM, drieux wrote:
On Jan 6, 2004, at 12:53 PM, Steve Grazzini wrote:
die usage() if @ARGV == 0 and -t;
You might not want to test if there is a
controlling terminal
I want to test whether STDIN (the default argument for -t)
is hooked up to the terminal (which is what -t
On Jan 6, 2004, at 3:17 PM, [EMAIL PROTECTED] wrote:
Case 3. (this is the difficult case for me) the script is
invoked with no file and no pipe to it. I would like the
script to end quietly
die usage() if @ARGV == 0 and -t;
I didn't show you how to check for the pipe (-p) because
this should pr
On Jan 5, 2004, at 10:44 AM, James Edward Gray II wrote:
DESTROY() is the traditionally accepted place to do something like
break a circular reference
Bzzzt! :-)
DESTROY can't be called *until* the circular reference is broken
(or the script exits and everything gets destroyed, regardless of
refc
On Dec 30, 2003, at 12:30 PM, Randy W. Sims wrote:
If you have a string that is going to need escaping, consider
using /\Q$string\U/ to handle quoting regex special chars.
Right -- but that should be \E (for "end") instead of \U (the
mnemonic for which is "uppercase", not "unquote").
% perl -le
On Fri, Dec 26, 2003 at 12:52:06PM -0500, Dan Anderson wrote:
> So, all in all, I think that my usage falls under the term fair use.
> I have no desire to circumvent Safari's security -- I'm just looking
> to speed up something I do which conforms to the TOS of the web site.
"Fair use" is copyri
On Mon, Dec 22, 2003 at 11:17:03AM -0800, Perl wrote:
> i know what " %9.1f" would have done in this case.
> but how does " %9.2g" round off ?
The *rounding* works like "%f", but there are some other
differences.
a) the precision (".2") applies to significant digits, not
digits after the d
On Dec 20, 2003, at 10:44 AM, Beau E. Cox wrote:
but I can't seem to figure out how to reopen STDIN to the
keyboard device. Any hints?
You could use:
open STDIN, '/dev/tty' or die "open: /dev/tty: $!";
Or you could just open another filehandle (e.g. TTY) and
read the user input from that, ra
On Dec 14, 2003, at 9:20 AM, Rob Dixon wrote:
Steve Grazzini wrote:
Actually, $_ isn't localized by 'while(<>)':
% echo test | perl -le 'for ("const") { print while <> }'
Modification of a read-only value attempted at -e line 1.
Which occ
[ Remailed to the list (sorry about that, Rob) ]
On Dec 13, 2003, at 9:07 AM, Rob Dixon wrote:
As a final thought, I would point out that $_ is a package ('our')
variable, but is localised by 'map', 'grep', 'foreach (LIST)' and
'while (<>)'.
Actually, $_ isn't localized by 'while(<>)':
% echo
On Tuesday, December 9, 2003, at 10:53 PM, Dan Anderson wrote:
Is it possible to specify the permissions of a file I create when I:
open ("FOO", "> ./bar")
or die ("Could not create file");
use Fcntl;
sysopen(FOO, $path, O_WRONLY|O_CREAT|O_TRUNC, 0750)
or die "sysopen: $path: $!";
--
Ste
On Fri, Nov 28, 2003 at 11:49:25PM -0800, drieux wrote:
> has anyone else bumped heads with the 5.8.1 perlio layer where
> the old school tie
>
> chomp(my $line = );
>
> now pops out if a sig handler is called on a signal, such as
> SIG_CHLD???
This looks like the new "safe signals" featur
David Wagner wrote:
> Dan Muey wrote:
@filelist = glob("w:/stleg/Colorado/House_98/*.htm");
And when I rename the directory to "House 98" (space instead of
underscore), the following does not:
>>
>> The reason is you escaped the space in $MyLoc but not in /House 98/.
>
> Under
On Sun, Nov 16, 2003 at 11:42:48AM -0500, Hacksaw wrote:
>> Pettiness says that you mean the package is a /class/ :)
>
> That's pedantism. ;-)
It's "pedantry". :-)
--
Steve
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Fri, Nov 14, 2003 at 01:24:53PM -0800, david wrote:
> David wrote:
>>> this normally can't be done cleanly and is generally not recommanded
>>> given there are other ways to accomplish bascially the same thing.
>
> Steve Grazzini wrote:
>> But why use
On Fri, Nov 14, 2003 at 12:25:41PM -0800, david wrote:
> Douglas Houston wrote:
>>
>> I am trying to initialize a dynamically-named array
>
> this normally can't be done cleanly and is generally not recommanded given
> there are other ways to accomplish bascially the same thing. but if you are
On Fri, Nov 14, 2003 at 04:30:05PM +, Douglas Houston wrote:
> On Fri, 14 Nov 2003, Jeff 'japhy' Pinyan wrote:
>> On Nov 14, Douglas Houston said:
>>
>>> I am trying to initialize a dynamically-named array
>>
>> You need to explain WHY you want to do this. There doesn't seem to me to
>> be a g
On Fri, Nov 14, 2003 at 11:40:51AM +, angie ahl wrote:
> I want to return an array and 2 scalars.
>
> sub EventList {
> my ($class, %arg) = @_;
> # load of code here
> return ([EMAIL PROTECTED], \$startdate, \$enddate);
> }
>
> So far so good (I think)
You're actually returning r
On Thu, Nov 13, 2003 at 09:16:59PM -, Rob Dixon wrote:
> Steve Grazzini wrote:
>> This is a documented optimization w/r/t foreach() loops, but the same
>> thing applies to the foreach() modifier.
>
> What the code is optimised to is a touch OT, but I've never seen th
On Thu, Nov 13, 2003 at 12:09:24PM -0800, John W. Krahn wrote:
> Rob Dixon wrote:
> > For the subscribers who don't already know,
> > what are the differences between my
> >
> > print for 1..5
>
> for iterates over the list 1..5 and sets $_ with each value and then
> print is called for each it
On Thu, Nov 13, 2003 at 10:06:19AM -0800, Ravi Malghan wrote:
> Hi: whatz the best way to copy an multidimensional
> array onto another. I have never used something like
> clone, just want to know whatz the easiest route.
Storable::dclone() is probably the easiest:
use Storable qw(dclone);
On Tue, Nov 11, 2003 at 05:02:28PM -0500, Bob Showalter wrote:
> > What am I doing wrong?
>
> You can't use a reference to a subroutine in @INC; you need to use paths.
It's a new feature (although the OP should probably be using FindBin
like you said).
% perldoc -f require
...
You
On Tue, Nov 11, 2003 at 04:12:03PM -0500, Raj (Basavaraj) Karadakal wrote:
> I am trying to package a perl script and the modules it uses , in a
> tar file. When untarred on any machine, the modules can be found in a known
> relative path with respect to the script. The path in which these modules
On Tue, Nov 11, 2003 at 01:25:03PM -, Rob Dixon wrote:
> Yomna el-Tawil wrote:
>>
>> for O'Reilly, i couldn't subscribe or even have the 14
>> days trial because i don't have a credit card.. :(
>
> I'm not sure what you mean here. O'Reilly is a book publisher
> who publishes, amongst other thi
On Wed, Nov 05, 2003 at 07:39:37PM -0500, Dan Anderson wrote:
> How can I tell whether or not a module exists, and what
> version it is?
There's no iron-clad rule, but the convention is for modules
to put it in the package variable $VERSION.
sub UNIVERSAL::require {
my ($module, $versi
On Wed, Nov 05, 2003 at 12:17:08PM -0500, Rich Fernandez wrote:
> I'm using CPAN.pm to install Bundle::CPAN (and others) and I get a message
> that says:
>
> make: cc: Command not found
>
> How can I specify gcc instead of cc without having to edit each individual
> Makefile?
You need to use the
On Tue, Nov 04, 2003 at 12:58:58PM -0800, Richard Heintze wrote:
> After several hours I tracked it down to these line of
> code. The concantenation is failing suddenly!
>
> my $hidden="";
> &FormElements(\$hidden...);
>
> sub FormElements{
> my $hidden = @_;
This sets $hidden to the number of
On Tue, Nov 04, 2003 at 12:45:58AM +0100, Paul Johnson wrote:
> On Mon, Nov 03, 2003 at 11:16:02PM -, Rob Dixon wrote:
>> Steve Grazzini wrote:
>>> The problem is that "-d $path" will return true if $path is a symlink
>>> to a directory.
>>
>>
On Mon, Nov 03, 2003 at 09:48:55AM -, Rob Dixon wrote:
> Steve Grazzini wrote:
> > That's fine if you *want* to skip the dotfiles. But you *always*
> > skip "." and "..". More robust code will also check for cycles, but
> > since File::Find does
On Sun, Nov 02, 2003 at 05:32:35PM -0600, James Edward Gray II wrote:
> On Sunday, November 2, 2003, at 06:19 AM, Rob Dixon wrote:
> > sub printdir {
> >
> >my $dir = shift;
> >
> >opendir DIR, $dir or die $!;
> >my @dirs = grep /[^.]/, readdir DIR;
>
> I'm not sure this grep() is wha
On Sun, Nov 02, 2003 at 03:25:59PM -0800, R. Joseph Newton wrote:
> Clint wrote:
> > sub barometer {
> > local $_ = shift;
>
> Don't do that. You are not using the default variable in the
> code at all, and it is a bad habit to be routinely tweaking
> system variables. What benefit did you
On Sat, Nov 01, 2003 at 05:20:39PM -0800, Jeff Westman wrote:
> I have a simple task that I am trying to do. Basically, I just want
> to list out my directories on disk, and then chdir to each one, print
> it out, and so on.
use File::Find;
find sub { print "$File::Find::name\n" if -d },
On Sat, Nov 01, 2003 at 11:02:25AM -0500, SilverFox wrote:
> hey guys, i'm trying to grep some data from a log file and getting the
> following error. Any ideas???
>
> [EMAIL PROTECTED] perl -e 'grep \"Eliminating movie\" update.log |awk {'print
> \$5'}';
% awk '/Eliminating movie/ { print $5
On Tue, Oct 28, 2003 at 10:51:20PM +0100, B. Fongo wrote:
> What may be wrong with my codes? Perl complains of use of uninitialized
> value at addition and in range (or flop).
>
> #!/usr/bin/perl -w
> use strict;
>
> my ($xi, $i, @numbers, @slice);
> @numbers = (1..10);
> $i = 0;
> $xi = 0;
>
>
On Tue, Oct 28, 2003 at 01:44:58PM -0600, Dan Muey wrote:
>> If you don't care about older perls (and 5.005_03 is getting
>> kind of mouldy) then do something like
>>
>> use 5.006;
>>
>> use base qw(Exporter);
>
> And that brings up another issue:
> what is the difference between:
>
On Tue, Oct 28, 2003 at 12:14:05PM -0600, Dan Muey wrote:
> Hmm ok, what would be nice is to do something like this:
> (I have a function that returns true if the perl version is the same or
> higher than the specified number)
>
> package Monkey;
>
> use strict;
>
> if(gotperlv(5.6)) {
> o
On Tue, Oct 28, 2003 at 10:52:16AM -0600, Dan Muey wrote:
> I want to use the newer our $variable; but to make it work
> with pre 5.6 Perl (or whatever version our appeared in) I
> have to do the use vars qw($variable); method
>
> So I was wanting some input about pros and cons of using
> eithe
On Mon, Oct 27, 2003 at 09:52:20PM -0600, Andrew Gaffney wrote:
> I have an array of keywords that I need to generate. I have 2 separate
> input files. The first one contains the defaults. The second input file
> contains additions and overrides. For example, first input:
>
> key1 key2 key3 key4
On Mon, Oct 27, 2003 at 03:21:50PM -0700, Wiggins d Anconia wrote:
> > This is what I tried:
> >
> > eval "use Tk";
>
> I would have thought in this case you would want the BLOCK form of
> 'eval' rather than the EXPR form? Or does it matter? Gurus can you
> expound on the differences in this ca
On Sat, Oct 25, 2003 at 12:17:37PM +0200, Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, David wrote:
>> 4. you have:
>>
>> unless (-e $path) {
>> print "Creating trash directory: $path\n";
>> mkdir $path or die "Couldn't create $path: $!\n";
>> }
>>
>> don't do this for a gene
On Thu, Oct 23, 2003 at 06:48:29AM -0700, R. Joseph Newton wrote:
> "Randal L. Schwartz" wrote:
> > > "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes:
> >
> > Dan> my $class = ref($proto) || $proto;
> >
> > Don't do this!
>
> I'm still a little mystified as to what you find offensive there.
On Wed, Oct 22, 2003 at 08:22:47PM -0500, Wiggins d'Anconia wrote:
> Gupta, Sharad wrote:
>> Now from this coderef ($x) i want to know its fully qualified name
>> which would be somthing like Bar::Foo. Is there a way to do that.??.
>
> Where do you want to know it? Presumably if you have set it th
On Wed, Oct 22, 2003 at 02:26:50PM -0400, Steve Grazzini wrote:
> #!/usr/bin/perl
> #
> # [ untested ]
> #
And it shows... :/
> die "Usage: $0 ERROR\n" unless @ARGV;
>
> my $num = shift;
> my $rx = qr/^#error$num$/;
>
> while (<>
On Wed, Oct 22, 2003 at 12:59:33PM -0500, Jason wrote:
> I have a file formatted like this:
[ snip ]
> #error12
> # Couldn't set the transfer mode to binary.
> #error12
>
> I want to write code that searches for an error number, and then
> prints everything in between the two error number lab
On Tue, Oct 21, 2003 at 01:06:44PM -0700, Jeff Westman wrote:
> Steve Grazzini <[EMAIL PROTECTED]> wrote:
> > On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote:
> > > # ... but can I do something like
> > > print "first\n" unless ($cou
On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote:
> # ... but can I do something like
> print "first\n" unless ($counter) else { print "second\n";
Not really. You could use the conditional operator, though.
print $counter ? "second\n" : "first\n";
--
Steve
--
To unsubscribe
On Tue, Oct 21, 2003 at 02:45:50PM -0400, Raghu Murthy wrote:
> How do I include a sed command in perl.
>
> If i do sed -e"s\./ " file_name it works fine at the command prompt.
> But if i include the sed command in perl it does not return any value.
>
> I tried doing system("sed -e"s\./.." f
On Tue, Oct 21, 2003 at 11:35:15AM -0700, LoBue, Mark wrote:
> Someone is missing the point, I'm not sure who yet.
I'll admit to going on a tangent... :-) The original topic was how
to create a shell alias from Perl.
> No, that won't work, because the alias command is running in a forked child.
On Sun, Oct 19, 2003 at 08:02:34PM -0700, R. Joseph Newton wrote:
> I think your formatting may reflect a misconception about if and
> elsif staements.
>
> while ($foo) {
> if ($condition_1) {
> do_1();
> }
> elsif ($condition_2) {
> do_2();
> }
> # ...
> }
>
> Should be:
Wait a m
On Fri, Oct 17, 2003 at 04:05:10PM -0700, Smoot Carl-Mitchell wrote:
> Steve Grazzini <[EMAIL PROTECTED]> wrote:
>
> > Have you actually tried ". perlscript" ? :-)
>
> This will not work.
Yes, anyone who tries it will realize this immediately. :-)
> s
On Fri, Oct 17, 2003 at 11:43:51AM -0700, LoBue, Mark wrote:
>>> You can also get tricky by running your perl script in the current
>>> environment using:
>>> . program_name (space after the dot)
>>> then your program could exit using exec('path/to/shell');
>>
>> I am not sure I understood the OP
On Fri, Oct 17, 2003 at 12:38:33PM -0500, Daniel Staal wrote:
> I need to open a filehandle in one sub, use it in several
> others, and then close it in a different sub yet. I'd pass it as a
> parameter, but all the subs are actually called by XML::Parser, so I
> don't get to choose the paramet
On Thu, Oct 16, 2003 at 02:01:54PM +0200, [EMAIL PROTECTED] wrote:
> Well this is good.
>
> But would be perfect to realy separate the STDERR from STDOUT. Probably will
> have diferent colors in the output. Can you get me that please.
It's right here:
> #my $pid = open3(\*WRITE, \*READ, \*ERROR
On Tue, Oct 14, 2003 at 06:24:07PM -0500, Daniel Staal wrote:
> --On Tuesday, October 14, 2003 15:59 -0700 "[EMAIL PROTECTED]"
> >Also in a slightly different scenario, how can i change the value
> >of the parameter itself with a sub.
> >
> >$a="ca";
> >toUpper($a); #change the $a value itself
>
On Tue, Oct 14, 2003 at 06:38:40PM -0400, Steve Grazzini wrote:
> On Tue, Oct 14, 2003 at 03:59:16PM -0700, [EMAIL PROTECTED] wrote:
> > Can someone shorten this upper routine?
> >
> > sub toUpper
> > { my $z = shift;
> > $z =~ tr/a-z/A-Z/;
> > return $
On Tue, Oct 14, 2003 at 03:59:16PM -0700, [EMAIL PROTECTED] wrote:
> Can someone shorten this upper routine?
>
> sub toUpper
> { my $z = shift;
> $z =~ tr/a-z/A-Z/;
> return $z;
> }
sub to_upper { uc shift }
> Also in a slightly different scenario, how can i change the value of the
> paramet
On Tue, Oct 14, 2003 at 08:19:12PM +0200, Ernest Beinrohr wrote:
> Hi, I'm trying to glue together an console application with readline
> extension (=I can edit the line befor I enter it). How can I make it
> work with Net::Server ?
>
> The readline package is "running" on the server size, altho
On Sun, Oct 12, 2003 at 05:35:21PM +0200, Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, Zentara wrote:
> > [EMAIL PROTECTED] (Igor Ryaboy) wrote:
> >
> > foreach (@kiddies){ $_->join(); }
>
> Printing these out (i.e.):
> foreach (@kiddies){
> $_->join();
> print "$_ joined.\n";
>
On Fri, Oct 10, 2003 at 03:56:43PM -0700, [EMAIL PROTECTED] wrote:
> Ok - I got it to work by changing the line to length >= 3
Good.
> 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.
Well now you have four rules. Again, I think
On Fri, Oct 10, 2003 at 03:11:52PM -0700, [EMAIL PROTECTED] wrote:
> This is not working as I expected:
>
> if(validate('abc.com'))
> { print "true"; }
> else
> { print "false"; }
It prints "false" (because the length is > 4).
> > sub validate {
> > local $_ = shift;
> > return( length
On Fri, Oct 10, 2003 at 12:37:02PM -0400, Kevin Old wrote:
> On Fri, 2003-10-10 at 11:46, Steve Grazzini wrote:
> > No. (It's ARG_MAX...)
>
> I'm running Mandrake 9.0 and my ARG_MAX is not set, so is it
> "unlimited"? If not, what is the default?
It&
On Fri, Oct 10, 2003 at 09:35:25AM -0400, Kevin Old wrote:
> On Fri, 2003-10-10 at 02:44, Steve Grazzini wrote:
> > On Thu, Oct 09, 2003 at 12:21:57PM -0400, Kevin Old wrote:
> > > Are you sure about using ls? We have directory here that has several
> > > thousand files
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
tr/.// == 1 and
/^[[:alpha:]]/ )
}
--
Steve
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
On Thu, Oct 09, 2003 at 11:58:31PM -0700, [EMAIL PROTECTED] wrote:
> here's the rules:
> starts with alphanumeric
> 4 chars long
> require one period
>
> /^[a-zA-Z][\w\-\.]{3,}$/
I wouldn't try to do it with one regex. You can probably come
up with one, but the next time you have to read this co
On Thu, Oct 09, 2003 at 12:21:57PM -0400, Kevin Old wrote:
> Are you sure about using ls? We have directory here that has several
> thousand files in it and when doing an ls *.whatever-extension we always
> get an "argument list too long".
>
> Any idea what the actual file limit is for grep?
It's
On Thu, Oct 09, 2003 at 11:54:00AM -0400, Kevin Old wrote:
> We use the Barracuda Spam appliance (barracudanetworks.com)
[ snip ]
> egrep: argument list too long
>
> It looks like their using grep via a system command or the grep function
> in Perl.
It's definitely the external grep...
> I kno
On Tue, Oct 07, 2003 at 01:09:26AM +0200, Kevin Pfeiffer wrote:
> I just noticed that:
>
> print join ", ", @list, "\n";
>
> produces output such as:
>
> a,
> a, b, c,
>
> whereas:
>
> print join(", ", @list), "\n";
>
> produces:
>
> a
> a, b, c
>
> (no trailing comma) -- strange... I think
On Thu, Oct 02, 2003 at 07:41:41PM -0700, [EMAIL PROTECTED] wrote:
> unless understood, how about this.
>
> if (defined $x and length $x)
>
> So, is this the opposite?
>
> if (! defined $x and ! length $x)
Nope; now you've got a boolean logic problem.
Either of these would work, but unless() is
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)
Nope; you've got a precedence problem.
unless( defined $x and length $x ) { }
--
Steve
--
To unsubscribe, e-mail: [EMAIL
On Thu, Oct 02, 2003 at 05:17:34PM +0200, Thomas B?tzler wrote:
> Todd Wade <[EMAIL PROTECTED]> wrote:
> > "Gary Stainburn" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > print while();
>
> This is bad because it first pulls in the file to
> build the list.
It doesn't. The
On Tue, Sep 30, 2003 at 11:03:02AM +0100, Dillon, John wrote:
> According to
> http://vipe.technion.ac.il/~shlomif/lecture/Perl/Newbies/lecture2/argv.html
> the following program will do ...whatever (make a backup of files) and it
> takes the file specified at the command line. I guessed from this
On Mon, Sep 29, 2003 at 11:04:46PM +0300, Ville Jungman wrote:
> This is real example from what i was doing yesterday:
> if($subs->anna_tilavuus($x+$lisax,$y+$lisay,$z) < 100){
> $subs->paivita($x);
> $udat{x}=$lisax;
> $udat{y}=$lisay;
> }elsif($subs->anna_tilavuus($x,$y+$lisay,
On Sun, Sep 28, 2003 at 11:48:19PM -0700, Dan Fish wrote:
> sub myfunc{ my ($query) = @_;
> $foo=$query->param("foo");
> ...more...blah...blah...
> }
>
> Everything works fine as is, but I'm trying to take the function "myfunc"
> out and put it in a separate .pm file because I need to call it fro
On Fri, Sep 26, 2003 at 08:13:07PM -0700, R. Joseph Newton wrote:
> Dan Anderson wrote:
> > use strict;
> > use warnings;
> >
> > END
> > {
> > print "Look ma, i'm using subroutines!";
>
> Shouldn't lie to your mama. That is not a subroutine. Its more a macro.
> I gets compiled vefore anythi
On Fri, Sep 26, 2003 at 08:30:29PM -0700, [EMAIL PROTECTED] wrote:
> Is this a current or outdated call? main'stderr
That's old-fashioned, but it doesn't seem to have been
deprecated (no warnings, at least).
In point of fact, it's better to use the capitalized STDERR,
since it's one of the magic
On Tue, Sep 23, 2003 at 03:01:47PM -0500, Dan Muey wrote:
> To see if the script running via the webserver can read a
> file I'd use -r and not -R right? If the file is owned by
> root then -R would return true if root has read permisions
> right?
Not really -- it tells you whether the "real" uid
On Tue, Sep 16, 2003 at 04:06:28PM +0200, Fischer Ulrich wrote:
> I upgraded my SuSE Linux from version 7.3 (perl 5.6..) to 8.2.
> (perl 5.8.0).
>
> Now I get the following error:
>
> Can't load '/sw/bin/dislin/perl/Dislin.so' for module Dislin:
> /sw/bin/dislin/perl/Dislin.so: undefined symbol:
On Fri, Sep 12, 2003 at 12:30:44PM -0500, Wiggins d'Anconia wrote:
> I know there were substantial improvements from 5.6.0 to 5.6.1 but I
> am not sure any of them will affect my code, any in particular I should
> be on the look out for?
It's perfectly usable, but 5.6.0 did end up with a reputatio
On Fri, Sep 12, 2003 at 08:32:38AM -0600, Eric Walker wrote:
> Does anyone have a good hold of how to do object oriented programming
> in perl? Maybe a few lines of code as examples?
There are some tutorials in the standard docs.
$ perldoc perlobj
$ perldoc perlboot
$ perldoc perltoo
On Thu, Aug 07, 2003 at 02:43:12PM -0400, Allison, Jason (JALLISON) wrote:
>if (scalar(@ReadyHandles) > 0)
>{
> ...
>else
>{
> if (! $ERRNO)
> {
> ...
> }
> else
> {
> # Error on select() call
> unless ($ERRNO == EINTR)
> {
>
On Sat, Aug 09, 2003 at 08:57:54PM -0700, Gupta, Sharad wrote:
>> You're supposed to return a filehandle:
>
> Yep. But i am using the temp files for doing that. And i
> would love to get rid of the temp files altogether.
>
>> open my $fh, '<', \($response->content);
>
> Seems like we are openin
On Sat, Aug 09, 2003 at 01:04:26PM -0700, Ahmed Moustafa wrote:
> Does a forked process share the memory locations of the global
> variables from the parent process?
Changes made after the fork() won't be visible in the other
process, if that's what you're wondering.
--
Steve
--
To unsubscrib
On Wed, Aug 06, 2003 at 09:37:52AM +0200, Martin A. Hansen wrote:
> i find it very annoying that i cannot simple dump all the functions
> connected to a certain object.
>
> but enough nagging. even if this is a tricky problem, cant it be
> solved?
>
> if using the ISA.pm as suggested, you are abl
On Tue, Aug 05, 2003 at 04:59:56PM +0100, Gary Stainburn wrote:
> Can anyone tell me how to fix this. I've tried untainting the
> $_[0] by storing it in a local variable and runing a regex to
> remove dodgy characters and that doesn't seem to fix it.
>
> sub dump_invoice {
> return unless (open
1 - 100 of 239 matches
Mail list logo