RE: How can we read files recursively?

2005-07-18 Thread Thomas Bätzler
Wiggins d'Anconia <[EMAIL PROTECTED]> wrote:
> Though it seems a bit odd that you want to recursively read a 
> filehandle.

It certainly would be a cool way to handle include
directives when parsing config files, i.e.

my $conf = "/etc/apache/httpd.conf"

open( my $fh, $conf ) or die "Can't open '$conf': $!";

my @todo = ( $fh );

while( @todo ){
  $fh = pop @todo;

  while( my $line = <$fh> ){
# parse config
# ...
if( $line =~ m/^\s+include\s+(\S+)/i ){
  push @todo, $fh;
  my $fname = qualify( dequote( $1 ) );
  open( $fh, $fname ) or die "Can't open '$fname': $!";
}
  }
}

I'll have to try that some time ;-)

Cheers,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: set environment variables

2005-07-18 Thread arjun.mallik

Oops ,
Mine was a wild guess and I am sorry for that. The below test was
successful in setting environment variable ...

 clip
#!/usr/bin/perl
use Env;

print "Before -->";
print  %ENV;
print "\n";
$ENV{TEMP}="xxx";
print "After --> \n";
print  %ENV;
print "\n";

system("echo $TEMP");
-clip--


Br
Arjun

Deserve before you desire







-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 19, 2005 9:20 AM
To: Mallik Arjun (WT01 - TELECOM SOLUTIONS)
Cc: [EMAIL PROTECTED]; beginners@perl.org
Subject: Re: set environment variables


"Because it's up-side down.
Why is that?
It makes replies harder to read.
Why not?
Please don't top-post." - Sherm Pendley, Mac OS X list


[EMAIL PROTECTED] wrote:
> Hi ,
> Try below.
> If you are using csh  for executing perl script -->
system("setenv
> TEMPHOME /tmp ");
> If your using bash for executing perl script ->   $TEMPHOME =
> "/tmp";
>
> system("export $TEMPHOME");
>
>
> Arjun
>
> Deserve before you desire
>
>

Did you test it? The problem with this approach is that you are setting
the environment in the subshell of 'system', but as soon as you have set
that variable your 'system' returns, the subshell process is destroyed
and the "new" environment has disappeared again. You must set the
environment once in the same subshell as the command you wish to run in
that shell. Generally you have the way the other posters have shown, by
setting the environment in Perl and then allowing the subshell to
inherit that environment, or by passing multiple commands in a single
shell call, generally by separating them with a semi-colon.

It is because each call to 'system' creates its own exclusive subshell
that the more obvious,

system("export VAR=value");
system("some_other_command");

Does not work.

http://danconia.org

>
>
>
>
>
> -Original Message-
> From: Nishi Prafull [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 19, 2005 1:49 AM
> To: Perl Beginners List
> Subject: set environment variables
>
>
> Hi:
>
> I need to run a script noted by $cmd1 from within perl but before that

> i need to set the environment variable. how can i do it? I tried my
> $TEMPHOME = "/tmp"; system($cmd1);
>
> But the script still complains the $TEMPHOME is not set. Thanks.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>
>
>
> Confidentiality Notice
>
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> addressee(s) and may contain confidential or privileged information.
> If you are not the intended recipient, please notify the sender at
> Wipro or [EMAIL PROTECTED] immediately and destroy all copies of
> this message and any attachments.
>



Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How can we read files recursively?

2005-07-18 Thread John W. Krahn
Japerlh wrote:
> How can we read files recursively?
> 
> Seems like filehandler is a global variable, no matter where it was defined.
> and put a openfile in a recursion function doesn't work.
> 
> Anyone can give me any hints?

perldoc -q filehandle


John

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: set environment variables

2005-07-18 Thread Wiggins d'Anconia
"Because it's up-side down.
Why is that?
It makes replies harder to read.
Why not?
Please don't top-post." - Sherm Pendley, Mac OS X list


[EMAIL PROTECTED] wrote:
> Hi ,
> Try below.
> If you are using csh  for executing perl script -->   system("setenv
> TEMPHOME /tmp ");
> If your using bash for executing perl script ->   $TEMPHOME =
> "/tmp";
> 
> system("export $TEMPHOME");
> 
> 
> Arjun
> 
> Deserve before you desire
> 
> 

Did you test it? The problem with this approach is that you are setting
the environment in the subshell of 'system', but as soon as you have set
that variable your 'system' returns, the subshell process is destroyed
and the "new" environment has disappeared again. You must set the
environment once in the same subshell as the command you wish to run in
that shell. Generally you have the way the other posters have shown, by
setting the environment in Perl and then allowing the subshell to
inherit that environment, or by passing multiple commands in a single
shell call, generally by separating them with a semi-colon.

It is because each call to 'system' creates its own exclusive subshell
that the more obvious,

system("export VAR=value");
system("some_other_command");

Does not work.

http://danconia.org

> 
> 
> 
> 
> 
> -Original Message-
> From: Nishi Prafull [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 19, 2005 1:49 AM
> To: Perl Beginners List
> Subject: set environment variables
> 
> 
> Hi:
> 
> I need to run a script noted by $cmd1 from within perl but before that i
> need to set the environment variable. how can i do it? I tried my
> $TEMPHOME = "/tmp"; system($cmd1);
> 
> But the script still complains the $TEMPHOME is not set. Thanks.
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 
> 
> 
> Confidentiality Notice
> 
> The information contained in this electronic message and any attachments to 
> this message are intended
> for the exclusive use of the addressee(s) and may contain confidential or 
> privileged information. If
> you are not the intended recipient, please notify the sender at Wipro or 
> [EMAIL PROTECTED] immediately
> and destroy all copies of this message and any attachments.
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: set environment variables

2005-07-18 Thread arjun.mallik

Hi ,
Try below.
If you are using csh  for executing perl script -->   system("setenv
TEMPHOME /tmp ");
If your using bash for executing perl script ->   $TEMPHOME =
"/tmp";

system("export $TEMPHOME");


Arjun

Deserve before you desire







-Original Message-
From: Nishi Prafull [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 19, 2005 1:49 AM
To: Perl Beginners List
Subject: set environment variables


Hi:

I need to run a script noted by $cmd1 from within perl but before that i
need to set the environment variable. how can i do it? I tried my
$TEMPHOME = "/tmp"; system($cmd1);

But the script still complains the $TEMPHOME is not set. Thanks.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 





Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How can we read files recursively?

2005-07-18 Thread Wiggins d'Anconia
Japerlh wrote:
> How can we read files recursively?
> 
> Seems like filehandler is a global variable, no matter where it was defined.
> and put a openfile in a recursion function doesn't work.
> 
> Anyone can give me any hints?
> Thanks a lot.
> 
> 

In newer perl's you can store a filehandle directly to a lexical
variable. This should allow you to do what you need.

my $FILEHANDLE;
open $FILEHANDLE, '/tmp/file/to/open' or die "Can't open file: $!";

Obviously the variable will need to be scoped to the subroutine.

Though it seems a bit odd that you want to recursively read a filehandle.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




How can we read files recursively?

2005-07-18 Thread Japerlh
How can we read files recursively?

Seems like filehandler is a global variable, no matter where it was defined.
and put a openfile in a recursion function doesn't work.

Anyone can give me any hints?
Thanks a lot.


-- 

Besh wishes,
Japerlh

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: escaping @

2005-07-18 Thread Wiggins d'Anconia
Lawrence Statton wrote:
>>On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote:
>>
>>>Charles Farinella wrote:
>>>
I'm sure this is very simple and I am overlooking something.  I want to
read a list of bad email addresses from a file and remove them from my
database.  

If I print $_, the email addresses are correct, if I try to remove them
from the db I get errors on just the characters before the @.

>>>
>>>Are you sure those errors aren't coming from the DB?
> 
> 
> Use placeholder constants.  Like this
> 
> - cut here -
> #!/usr/bin/perl
> use strict;
> use warnings; 
> use Data::Dumper;
> 
> use DBI;
> 
> our $DBH = DBI->connect( 'dbi:Pg:dbname=test', undef , undef ); 
> 
> die "no database" unless $DBH; 
> 
> while ()
> {
> chomp;
> $DBH->do( qq {
>   DELETE FROM email
>   WHERE address = ?
>   } , {} , $_ ) or print $DBH->errstr; 
> }
>

Careful with such advice, switching a statement from an update where you
set an empty string is *significantly* different than switching to a
delete. I even resisted the urge to switch the setting to '' to a NULL
as that technically may not fit with his data model.

Obviously from my other posts I agree about using placeholders, though I
don't agree with using a 'do' in a loop. TMTOWTDI.

http://danconia.org

> __DATA__
> Evil Spacey [EMAIL PROTECTED]
> - cut here -
> 
> 
> If you absolutely refuse to do this (and be prepared to suffer a life
> of SQL injection if you do so refuse) then at LEAST call $dbh->quote()
> on strings before you hand them off to DBI.
> 
> 
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Error on: my $sth->execute;

2005-07-18 Thread Christian, Ed
> -Original Message-
> From: Ron Smith [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 18, 2005 12:50 PM
> To: Perl
> Subject: Error on: my $sth->execute;
> 
> 
> Hi all,
>  
> I'm getting an error when trying to do an INSERT statement to 
> a MySQL database. There's something I'm not understanding 
> here. Can anyone point me in the right direction? I also 
> tried a "do" method, but got the same error. I know the 
> "param" function is loading the values from the form, because 
> I've used a "print" statement to check the variables.
>  
> TIA
> Ron
>  
> -snip---
> Software error:
> Can't call method "execute" on an undefined value at 
> C:/www/cgi-bin/load_company_products.cgi line 21.
> For help, please send mail to the webmaster 
> ([EMAIL PROTECTED]), giving this error message and the time and 
> date of the error.
> -snip---
> my $sth->execute; <=line 21

Try ditching the "my".

$sth->execute() or die "Error: $DBI::errstr\n";

> $dbh->disconnect;
> 
> #my $sth->do("INSERT INTO products VALUES ('$sku', 
> '$partNum', '$name', '$descr', '$stockNum', '$qty', '$img', 
> 'vendNum', '$price')");
> snip---
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Usage of defaultvariable @_ with shift

2005-07-18 Thread John W. Krahn
Mathias Pasquay wrote:
> Dear list,

Hello,

> i'am just wondering about the behaviour of shift and the defaultvariable @_ .
> 
> I use the following code::
> 
> while () { # each line of RULEFILE is stored in 
> $_
>   chomp;# delete \n from $_
>   split /;/;   # split the fields of $_ seperated 
> by ; into @_

You should have gotten the warning "Use of implicit split to @_ is
deprecated" which means that you shouldn't do that.  You should enable
warnings.

   my @array = split /;/;


>   print "Array before shift: @_\n"; # prints @_  
>   my $test = shift @_;# $test gets the first 
> item from @_
>   print "Array after shift: @_\n";#  print @_ without the 
> first item
> } 
> 
> everything works fine.
> 
> Now i change the line "my $test = shift @_" into "my $test = shift". This 
> should work because shift should use @_ by default.

No, in this case it uses @ARGV by default.

perldoc -f shift


> But in this case $test is empty an the second print command prints still the 
> whole @_.
> 
> I really don't know why this should not work?
> 
> I would be happy about any help.


John

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




set environment variables

2005-07-18 Thread Nishi Prafull
Hi:

I need to run a script noted by $cmd1 from within perl but before that
i need to set the environment variable. how can i do it?
I tried
my $TEMPHOME = "/tmp";
system($cmd1);

But the script still complains the $TEMPHOME is not set.
Thanks.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Object persistence

2005-07-18 Thread Scott R. Godin
One other thing that's bugging me about this is how to provide the 
config data to the scripts at runtime in a web environment.


If this were a one-time script it would be simple to hard-code them in, 
but we expect to be able to re-use the package for multiple client 
environments.


The constraints of a web-environment prevent me from creating a file in 
the DOCUMENT_ROOT directory to hold the username,pass,database data (in 
say a YAML format file) although nothing is preventing me from using the 
form data to create a tmpfile and then sending that file to the user as 
a download with instructions on where to place it.


Or, alternatively, at install time, I could have a subscriber_config 
executable script set up such that it creates a Subscriber::Config.pm 
file along the lines of how CPAN's config works (possibly)... again I'm 
up against the constraints of which directories Apache will have access 
to when serving the content.


it's easy enough to create an .htsub_config file in DOCUMENT_ROOT and 
ensure that .htaccess or /etc/httpd/conf/httpd.conf has something along 
the lines of:



Order allow,deny
Deny from all


that would prevent the contents of the file form being served to 
end-users but still allow access to them from the scripts being run on 
the server.


But I'll need some way to generate the file (either from the command 
line at install time, or from the web at setup/configure time), and also 
to parse it at script-runtime so that I can populate Subscriber::DB with 
the access information.


a pretty nest of thorns to step carefully through, no matter what. *sigh* :)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: set environment variables

2005-07-18 Thread Nishi Prafull
I ttied it inside the perl script, but does not seem to work.
I did a echo for $TEMPHOME but it was not set.


On 7/18/05, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Nishi Prafull wrote:
> > Hi:
> 
> Hello,
> 
> > I need to run a script noted by $cmd1 from within perl but before that
> > i need to set the environment variable. how can i do it?
> > I tried
> > my $TEMPHOME = "/tmp";
> > system($cmd1);
> >
> > But the script still complains the $TEMPHOME is not set.
> > Thanks.
> 
> You probably want (untested):
> 
> $ENV{ TEMPHOME } = '/tmp';
> 
> 
> John
> 
> --
> 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]
 




Re: Error on: my $sth->execute;

2005-07-18 Thread Ron Smith
--- Lawrence Statton <[EMAIL PROTECTED]> wrote:

> > --0-551411304-1121705388=:507
> > Content-Type: text/plain; charset=iso-8859-1
> > Content-Transfer-Encoding: 8bit
> > 
> > Hi all,
> >  
> > I'm getting an error when trying to do an INSERT
> statement to a MySQL databas
> > e. There's something I'm not understanding here.
> Can anyone point me in the r
> > ight direction? I also tried a "do" method, but
> got the same error. I know th
> > e "param" function is loading the values from the
> form, because I've used a "
> > print" statement to check the variables.
> >  
> > TIA
> > Ron
> >  
> >
> -snip---
> > Software error:
> > Can't call method "execute" on an undefined value
> at C:/www/cgi-bin/load_comp
> > any_products.cgi line 21.
> > For help, please send mail to the webmaster
> ([EMAIL PROTECTED]), giving this er
> > ror message and the time and date of the error.
> >
> -snip---
> 
> 1) Your first mistake is never checking for any
> errors;
> 
> my $dbh = DBI->conect(...) or
>  die "...helpful error message...";
I was using: 

my $dbh = DBI->connect("DBI:mysql:company",
"geeksatlarge") or die "Error: $DBI::errstr\n";

but will try:

die "no database: ", DBI->errstr unless $DBH;

Thanks!
> 
> Perhaps ESPECIALLY interesting would be around line
> 20 adding
> something of the form
> 
> my $sth = $dbh->prepare($sql) or
>   die "There is no statement handle because: ",
> $dbh->errstr;
>
Yep! I saw a lot of mail on this one. I'm removing the
extra "my". It was an oversight. :-)
 
> 2) Use placeholders.  REALLY -- where the [EMAIL PROTECTED] are
> people learning to 
>write SQL?
> 
> 3) I have a personal bias against the format of
> insert you have used,
>and it makes it utterly impossible to help debug
> your code because
>now a critical piece of data ( the output of a
> DESCRIBE products)
>is invisible to us.  
> 
>I always prefer the "INSERT INTO table ( col,
> col, col ) VALUES (
>?, ? , ? ) ; form as it handles much more
> gracefully the addition
>of columns in a table.

Yes, the though had crossed my mind to use this
format, so I'm switching over; also, using
placeholders.

I won't be able to test any corrections until tonight
or tomorrow though.

Thanks, to everyone on the list for help while I'm in
Perl/CGI infancy. ;-)

Ron Smith

> #!/www/perl/bin/perl -wT
> use strict;
> use DBI;
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser);
> my $sku = param('sku');
> my $partNum = param('partNum');
> my $name = param('name');
> my $descr = param('descr');
> my $stockNum = param('stockNum');
> my $qty = param('qty');
> my $img = param('img');
> my $vendNum = param('vendNum');
> my $price = param('price');
> my $dbh = DBI->connect("DBI:mysql:company",
> "username", "password") or die "Error:
> $DBI::errstr\n";
> my $sql = "INSERT INTO products VALUES ('$sku',
> '$partNum', '$name', '$descr', '$stockNum', '$qty',
> '$img', 'vendNum', '$price')";
> my $sth = $dbh->prepare($sql);
> my $sth->execute; <=line 21
> $dbh->disconnect;
> 
> 
> So, let's build a test script that includes all of
> the things I
> mentioned.
> -- cut here
> 
> #!/usr/bin/perl
> use strict;
> use warnings; 
> use Data::Dumper;
> use DBI;
> 
> our $DBH = DBI->connect( 'dbi:mysql:dbname=test',
> undef , undef ); 
> 
> die "no database: ", DBI->errstr unless $DBH; 
> 
> 
> # version for running in CGI
> #my ($sku, $partNum, $name, $descr, $stockNum,
> #$qty, $img, $vendNum, $price) = map { param($_)
> } qw / sku partNum name descr stockNum qty img
> vendNum price /; 
> 
> 
> #
> # brute force for testing
> #
> my $sku = '123456';
> my $partNum = '501-1627';
> my $name = 'TGX Frame Buffer';
> my $descr = 'Sun TGX frame buffer; CG6';
> my $stockNum = 'A-102-55';
> my $qty = 10;
> my $img = undef;
> my $vendNum = '5011627';
> my $price = '12.75';
> 
> my $sql = qq { INSERT INTO
>  product
>  ( sku, partNum, name, descr, stockNum, qty,
> img, vendNum, price )
>  VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )
>  };
> 
> my $sth = $DBH->prepare($sql);
> 
> die "No statement handle: ", $DBH->errstr unless
> $sth;
> 
> my $rv = $sth->execute( $sku, $partNum, $name,
> $descr, $stockNum, $qty, $img, $vendNum, $price );
> 
> doe "Something was wrong: ", $sth->errstr unless
> defined $rv;
> 
> print "JOY";
> 
> $DBH->disconnect;
> -- cut here
> 
> 
> 
> This works.
> 
> By the way, in copying your program I found your
> bug.  Look lin line
> 20 and it should stand out.
> 
> 
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




catching signal for an email notification

2005-07-18 Thread DBSMITH
Perl'ers

I my code I wrote a routine that executes return code signals.  My point
being is if after any particular line of code make a call to check its
success or failure.
My question is if after any code system call or non system call failure
according to

$? == -1
? & 127 or
$? >> 8

can I send an email with that return code in as the message and or subject?
I f so how and what would the code look like?

thank you,
derek


Please see lines 70-84 and 124

(See attached file: test.pl)


Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams


test.pl
Description: Binary data
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


Re: set environment variables

2005-07-18 Thread Scott R. Godin

Nishi Prafull wrote:


On 7/18/05, John W. Krahn <[EMAIL PROTECTED]> wrote:


Nishi Prafull wrote:


Hi:


Hello,



I need to run a script noted by $cmd1 from within perl but before that
i need to set the environment variable. how can i do it?
I tried
my $TEMPHOME = "/tmp";
system($cmd1);

But the script still complains the $TEMPHOME is not set.
Thanks.


You probably want (untested):

$ENV{ TEMPHOME } = '/tmp';



I ttied it inside the perl script, but does not seem to work.
I did a echo for $TEMPHOME but it was not set.




$ perl -wle 'no warnings "uninitialized"; print $ENV{TEMPHOME}; 
$ENV{TEMPHOME} = "/tmp"; print $ENV{TEMPHOME}; print `env | grep TEMP`'


/tmp
TEMPHOME=/tmp

as you can see, once you've set it via %ENV you can access the env 
variable from a shell started from within the perl script.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: set environment variables

2005-07-18 Thread John W. Krahn
Nishi Prafull wrote:
> Hi:

Hello,

> I need to run a script noted by $cmd1 from within perl but before that
> i need to set the environment variable. how can i do it?
> I tried
> my $TEMPHOME = "/tmp";
> system($cmd1);
> 
> But the script still complains the $TEMPHOME is not set.
> Thanks.

You probably want (untested):

$ENV{ TEMPHOME } = '/tmp';


John

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Object persistence

2005-07-18 Thread Scott R. Godin

Jeff 'japhy' Pinyan wrote:

On Jul 13, Scott R. Godin said:


http://www.webdragon.net/miscel/DB.pm


I'll check it out.

All Subscriber::DB objects would share the DBI object -- there's no 
need for a billion database handles. 


ok, so possibly one should do it differently than I have, in my example.


Well, look at it this way:  either the Subscriber::DB object holds the 
database, or it holds a subscriber.  Choose.


If it holds the database, then it needs a method to lookup, create, and 
return a Subscriber object from the database.


If it holds the subscriber, it needs to CALL the database to populate 
itself.


Normally by this time I've been able to 'envision' the finished product 
entirely, and it's just a matter of breaking it into smaller steps, 
coding them, and glueing them together. That hasn't been the case with 
this project.


Perhaps if I back up a bit and fill in some of the surrounding tasks, it 
will make things clearer for you, and enable you to help make them 
clearer for me. :-)


But what I had thought of doing would be to populate the object via 
the database and fill it entire, thus being able to call any of the 
Subscriber methods on it without generating multiple calls to the 
database for each one.


Ah, so by "object persistence" you mean that you want to create the 
objects from the state they had in the database, and then when you're 
done with them, save them back to the database?  That seems reasonable, 
if you're not going to have multiple processes accessing and changing 
this information.


The way I envisioned it was very similar to a tie() mechanism.  Every 
access or setting of a value triggers a database action.  Your method is 
certainly less of a strain on the database.


I had initially thought of some sort of tie-ing myself but realized I'd 
be putting a bit of a strain on the database in some instances.. it 
*may* not be a factor though, depending on how it will ultimately get used.


The goals here are:

  o online database of subscribers (prefer email/snailmail for 
receiving regular newsletters and coupons), with optional 
birthday/anniversary for receiving special coupons.
  o some sort of mailing list (possibly Mail::SimpleList) to send the 
e-mails out.
  o method for the user to change their own data (possibly thru 
generation of unique URL's)

  o methods of administration
* make individual changes to user data
* generate a csv-style snapshot of the db or (sections of the db 
for snailmailings)
* methods for generating individualized template-driven 
coupons/mailings to the list of subscribers.

* remove users from the list on request.

With that in mind, the dataflow I had imagined would be:

I.
1. Subscriber signs up to the list online (or fills out card manually 
and someone else does data-entry)
  1a. online form accepts data, taint-checks it, error-checks it, and 
inserts it into the db
2. if we have their e-mail, send a welcome message on entry. 
(MIME::Lite, or Mail::Mailer, et.al.)
3. once per day, an advance mailing is generated (via cronjob) for 
pending birthdays and anniversaries), preferably somehow personalized 
with data from the database.
4. regular mailings get sent periodically, again preferably somehow 
personalized.


II.
1. User moves and wants to change their address/phone/email
   HOW do we enable this for them so as to require as little admin 
intervention as possible?

2. User's email bounces.
   HOW to handle?
3. User wishes to permanently unsubscribe.
   Again preferring to do this without admin intervention.


So, there will be instances where only one user will be handled, and 
instances where we'll be sifting through all the users for specific data 
(email, snailmail, birthday, anniversary)


I'm leaning towards (per your comments above) the Subscriber::DB holding 
the database, with methods to create, lookup and return, alter, and 
delete a Subscriber (object), which can then use the methods in 
Subscriber to format its internal data however I need it, (possibly as I 
cycle through a LIST of returned Subscribers, depending on the lookup 
request)


Does it sound like I'm looking in the right directions ?


[remainder snipped for later follow-up]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Error on: my $sth->execute;

2005-07-18 Thread Adriano Ferreira
On 7/18/05, Adriano Ferreira <[EMAIL PROTECTED]> wrote:
> Beware of the difference of double and single quotes in Perl. Double
> quotes interpolate:

Oops. That's my mistake. Your single quotes are within double quotes.

Let's try again. I would say that something is wrong here:

my $sth = $dbh->prepare($sql);

which probably returns undef to $sth and then you see the error you
mentioned when invoking 'execute' over it.

my $sth->execute; <=line 21

Try telling DBI to raise errors so that you can see them as soon as they happen:

my $dbh = DBI->connect("DBI:mysql:company", "username", "password", 
{ RaiseError => 1}) 

Regards,
Adriano

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Error on: my $sth->execute;

2005-07-18 Thread Adriano Ferreira
On 7/18/05, Ron Smith <[EMAIL PROTECTED]> wrote:
> my $sql = "INSERT INTO products VALUES ('$sku', '$partNum', '$name', 
> '$descr', '$stockNum', '$qty', '$img', 'vendNum', '$price')";

Beware of the difference of double and single quotes in Perl. Double
quotes interpolate:

$a = 3;
print "a: $a\n" # prints 'a: 3' and a new line

Single quotes don't interpolate neither do common escapes like "\n"

print 'a: $a\n' # prints 'a: $a\n"

Regards,
Adriano.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Download and post in web page pdf file(s)

2005-07-18 Thread Wiggins d'Anconia
Roberts Mr Richard L wrote:
> Hi,
> Does anyone know how/where I can resolve scp pdf files (user selected) and
> display in a web page?
> thanks
> -r
> 

I suspect the reason this post hasn't gotten more response is because it
is incredibly unclear. What do you mean by "how/where" or "resolve" or
"(user selected)" for that matter. We aren't mind readers.

Help us to help you,

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Error on: my $sth->execute;

2005-07-18 Thread Ron Smith
Hi all,
 
I'm getting an error when trying to do an INSERT statement to a MySQL database. 
There's something I'm not understanding here. Can anyone point me in the right 
direction? I also tried a "do" method, but got the same error. I know the 
"param" function is loading the values from the form, because I've used a 
"print" statement to check the variables.
 
TIA
Ron
 
-snip---
Software error:
Can't call method "execute" on an undefined value at 
C:/www/cgi-bin/load_company_products.cgi line 21.
For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving this 
error message and the time and date of the error.
-snip---
#!/www/perl/bin/perl -wT
use strict;
use DBI;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
my $sku = param('sku');
my $partNum = param('partNum');
my $name = param('name');
my $descr = param('descr');
my $stockNum = param('stockNum');
my $qty = param('qty');
my $img = param('img');
my $vendNum = param('vendNum');
my $price = param('price');
my $dbh = DBI->connect("DBI:mysql:company", "username", "password") or die 
"Error: $DBI::errstr\n";
my $sql = "INSERT INTO products VALUES ('$sku', '$partNum', '$name', '$descr', 
'$stockNum', '$qty', '$img', 'vendNum', '$price')";
my $sth = $dbh->prepare($sql);
my $sth->execute; <=line 21
$dbh->disconnect;

#my $sth->do("INSERT INTO products VALUES ('$sku', '$partNum', '$name', 
'$descr', '$stockNum', '$qty', '$img', 'vendNum', '$price')");
snip---



Re: escaping @

2005-07-18 Thread Wiggins d'Anconia
Charles Farinella wrote:
> On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote:
> 
>>Charles Farinella wrote:
>>
>>>I'm sure this is very simple and I am overlooking something.  I want to
>>>read a list of bad email addresses from a file and remove them from my
>>>database.  
>>>
>>>If I print $_, the email addresses are correct, if I try to remove them
>>>from the db I get errors on just the characters before the @.
>>>
>>
>>Are you sure those errors aren't coming from the DB?
> 
> 
> I'm getting this:
> ==
> DBD::Pg::st execute failed: ERROR:  column "mmartins" does not exist at
> delBadEmail.pl line 23,  line 378.
> ==
> 
> If I put the address, '[EMAIL PROTECTED]' in the script, that works
> fine.
> 
> If I insert the '\' in front of @ in $_ it throws this:
> ==
> DBD::Pg::st execute failed: ERROR:  syntax error at or near "\" at
> character
> 127 at delBadEmail.pl line 23,  line 378 (#7)
> ==
> 
> I'm confused as to what it wants.  :-(
>

That is because the value is not quoted.

> The solution John Moon sent me didn't work, it send me a bound variable
> error.
> 

Did you try the one I sent below?  What were the errors?  What exactly
was the "bound variable" error?  Remember, we can't see what you are seeing.

http://danconia.org

>>--Untested--
>>#!/usr/bin/perl -w
>>
>>use strict;
>>use DBI;
>>use DBD::Pg;
>>
>>my $infile = $ARGV[0];
>>
>># no reason to reconnect for every line
>>my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die;
>>
>># statement should only be prepared once
>># note use of placeholder ? character
>>my $sth = $dbh->prepare("UPDATE table SET email = '' WHERE email = ? ")
>>|| die;
>>
>>open INFILE, "<$infile" or die "Can't open file for reading: $!";
>>while (  ) {
>>   $sth->execute( $_ );
>>}
>>close INFILE;
>>
>>$sth->finish;
>>$dbh->disconnect;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: escaping @

2005-07-18 Thread Charles Farinella
On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote:
> Charles Farinella wrote:
> > I'm sure this is very simple and I am overlooking something.  I want to
> > read a list of bad email addresses from a file and remove them from my
> > database.  
> > 
> > If I print $_, the email addresses are correct, if I try to remove them
> > from the db I get errors on just the characters before the @.
> >
> 
> Are you sure those errors aren't coming from the DB?

I'm getting this:
==
DBD::Pg::st execute failed: ERROR:  column "mmartins" does not exist at
delBadEmail.pl line 23,  line 378.
==

If I put the address, '[EMAIL PROTECTED]' in the script, that works
fine.

If I insert the '\' in front of @ in $_ it throws this:
==
DBD::Pg::st execute failed: ERROR:  syntax error at or near "\" at
character
127 at delBadEmail.pl line 23,  line 378 (#7)
==

I'm confused as to what it wants.  :-(

The solution John Moon sent me didn't work, it send me a bound variable
error.

> > Here is what I have:
> > 
> > ==
> > #!/usr/bin/perl -w
> > 
> > use strict;
> > use DBI;
> > use DBD::Pg;
> > 
> > my $infile = $ARGV[0];
> > 
> > 
> > open( INFILE, "<$infile" );
> > while(  ) {
> > my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die;
> > 
> > #s/\@/\\@/;
> > #print $_;
> > 
> > my $sth = $dbh->prepare("UPDATE
> > table
> > SET
> > email = ''
> > WHERE
> > email = $_ ") || die;
> 
> The above value needs to be quoted for the DB not Perl. But it would be
> much more efficient to use placeholders and move your statement
> preparation outside of the loop and then provide the e-mail address to
> the execute. This will take care of your quoting problems and be more
> efficient.
> 
> > 
> > $sth->execute;
> > 
> > finish $sth;
> > $dbh->disconnect;
> > }
> > 
> > close( INFILE );
> > ==
> > 
> 
> Only do things in the loop that must be done in the loop. Reconnecting,
> repreparing, and disconnecting from the DB is a lot of unnecessary work.
> 
> perldoc DBI
> 
> 
> --Untested--
> #!/usr/bin/perl -w
> 
> use strict;
> use DBI;
> use DBD::Pg;
> 
> my $infile = $ARGV[0];
> 
> # no reason to reconnect for every line
> my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die;
> 
> # statement should only be prepared once
> # note use of placeholder ? character
> my $sth = $dbh->prepare("UPDATE table SET email = '' WHERE email = ? ")
> || die;
> 
> open INFILE, "<$infile" or die "Can't open file for reading: $!";
> while (  ) {
>$sth->execute( $_ );
> }
> close INFILE;
> 
> $sth->finish;
> $dbh->disconnect;
-- 
Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
603.924.6079


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Techno Boi -- was Re: Regular Expressions : Help in understanding

2005-07-18 Thread dave.w.turner
Oops - mean't to group reply

On 7/18/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> H.  Maybe techno enough to know how to download stuff his
> mummy and daddy wouldn't approve of??
> 
> On 7/17/05, robert johnson <[EMAIL PROTECTED]> wrote:
> >
> > so, am i to read his email as "kisses and hugs from techno-boy?"
> >
> > so... that's not "techno" in the sense the boy could ever figure out how to
> > unsubscribe from a mailing list.
> >
> > oh wait, i'll bet the boy is "techno" in the sense can send kisses and hugs
> > over AOL Instant Message.
> >
> > ok, i get it now.
> >
> >
> >
> > --- jm <[EMAIL PROTECTED]> wrote:
> >
> > > not sure about the rest of its name but at least it got the "b0y"
> > > right (unless it's also gender- as well as maturity-challenged, of
> > > course)
> > >
> > > On 7/17/05, x0x_t3chn0b0y_x0x <[EMAIL PROTECTED]> wrote:
> > > > FUCKERS REMOVE ME
> > > > IF USED THE UNSUBSCRIBE IT DONT WORK
> > > >
> > > > FUCKERS REMOVE ME
> > > > IF USED THE UNSUBSCRIBE IT DONT WORK
> > > >
> > > > FUCKERS REMOVE ME
> > > > IF USED THE UNSUBSCRIBE IT DONT WORK
> > > >
> > > > --
> > > > 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]
> > >  
> > >
> > >
> > >
> >
> >
> > --Rob
> >
> > Programmers have been likened to modern day Sorcerers.  Well, I'm the 
> > Mickey Mouse apprentice who spawned an infinite number of zombie broom 
> > processes, and got in big trouble when the Sorcerer came back.
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >  
> >
> >
> >
> 
> 
> --
> 
> Dave
> All us base are belong to you.
> 


-- 

Dave
All us base are belong to you.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: array

2005-07-18 Thread Larsen, Errin M HMMA/Information Technology Department
[EMAIL PROTECTED] wrote:
> By the way, since you mentioned chomp - what is the difference
> between chomp and chop?  I think they are both for removing some type
> of un-needed whitespace - does one do space, and the other newline or
> something?   
> 
>> also chomp() the $guess variable to remove the unneeded newline.
> 
> 
> --
> 
> Dave
> All us base are belong to you.

perldoc -f chomp
perldoc -f chop

One removes the last character of a line, the other removes the newline
("\n") at the end of a line.

--Errin

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: escaping @

2005-07-18 Thread Wiggins d'Anconia
Charles Farinella wrote:
> I'm sure this is very simple and I am overlooking something.  I want to
> read a list of bad email addresses from a file and remove them from my
> database.  
> 
> If I print $_, the email addresses are correct, if I try to remove them
> from the db I get errors on just the characters before the @.
>

Are you sure those errors aren't coming from the DB?

> Here is what I have:
> 
> ==
> #!/usr/bin/perl -w
> 
> use strict;
> use DBI;
> use DBD::Pg;
> 
> my $infile = $ARGV[0];
> 
> 
> open( INFILE, "<$infile" );
> while(  ) {
> my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die;
> 
> #s/\@/\\@/;
> #print $_;
> 
> my $sth = $dbh->prepare("UPDATE
> table
> SET
> email = ''
> WHERE
> email = $_ ") || die;

The above value needs to be quoted for the DB not Perl. But it would be
much more efficient to use placeholders and move your statement
preparation outside of the loop and then provide the e-mail address to
the execute. This will take care of your quoting problems and be more
efficient.

> 
> $sth->execute;
> 
> finish $sth;
> $dbh->disconnect;
> }
> 
> close( INFILE );
> ==
> 

Only do things in the loop that must be done in the loop. Reconnecting,
repreparing, and disconnecting from the DB is a lot of unnecessary work.

perldoc DBI


--Untested--
#!/usr/bin/perl -w

use strict;
use DBI;
use DBD::Pg;

my $infile = $ARGV[0];

# no reason to reconnect for every line
my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die;

# statement should only be prepared once
# note use of placeholder ? character
my $sth = $dbh->prepare("UPDATE table SET email = '' WHERE email = ? ")
|| die;

open INFILE, "<$infile" or die "Can't open file for reading: $!";
while (  ) {
   $sth->execute( $_ );
}
close INFILE;

$sth->finish;
$dbh->disconnect;


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: array

2005-07-18 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote:
> By the way, since you mentioned chomp - what is the difference between
> chomp and chop?  I think they are both for removing some type of
> un-needed whitespace - does one do space, and the other newline or
> something?
> 
> 
>>also chomp() the $guess variable to remove the unneeded newline.
> 
> 
> 

perldoc -f chomp
perldoc -f chop

Should clear everything up. The basic difference is that the second
removes one character, period, the first removes the input record separator.

perldoc perlvar for more about $/

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: array

2005-07-18 Thread dave.w.turner
By the way, since you mentioned chomp - what is the difference between
chomp and chop?  I think they are both for removing some type of
un-needed whitespace - does one do space, and the other newline or
something?

> also chomp() the $guess variable to remove the unneeded newline.


-- 

Dave
All us base are belong to you.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: escaping @

2005-07-18 Thread Moon, John
Subject: escaping @

I'm sure this is very simple and I am overlooking something.  I want to
read a list of bad email addresses from a file and remove them from my
database.  

If I print $_, the email addresses are correct, if I try to remove them
from the db I get errors on just the characters before the @.

Here is what I have:

==
#!/usr/bin/perl -w

use strict;
use DBI;
use DBD::Pg;

my $infile = $ARGV[0];


open( INFILE, "<$infile" );
while(  ) {
my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die;

#s/\@/\\@/;
#print $_;

my $sth = $dbh->prepare("UPDATE
table
SET
email = ''
WHERE
email = $_ ") || die;

$sth->execute;

finish $sth;
$dbh->disconnect;
}

close( INFILE );
==

Please try...


open( INFILE, "<$infile" ); 
my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die; 
my $sth = $dbh->prepare(q{UPDATE table 
SET email = '' WHERE email = ? "}) || die;
while(  ) {
$sth->execute($_);
...


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Limit memory used by perl

2005-07-18 Thread Jay Savage
On 7/16/05, Chris Devers <[EMAIL PROTECTED]> wrote:
> On Thu, 14 Jul 2005, Beast wrote:
> 
> > I have prototype that should parse big log files (680MB) converted
> > into nice GUI apps. It's not nice if the machine totaly freeze during
> > testing. (linux 512MB/2GB swap).
> 
> Are you trying to read the whole file in at once, or are you trying to
> read through it using data as you walk along?
> 
> Hint: the latter approach can be far more memory efficient.
> 
> There are OS tricks that can help accomodate a misbehaving program, but
> they rarely work as well as reconsidering algorithms in that program.
> 
> 
> --
> Chris Devers

Exactly.

The short answer, here, is "yes". But that isn't very helpful. So why
don't you tell us what you mean by limit, and what your goal is.
'ulimit' and it's clones and relatives will keep a system from
crashing by causing the program to abort if it uses more than its
allotted memory. That saves you system, but your program will never
finish executing.

What you probably want to do is examine the approach you're taking.
Figure out why you're using so much memory, and refactor the code.

I'm sure that with some specific examples people on this list will be
happy to help you figure out how to do that.

In other words, if you want a useful answer from this list, submit the
problematic code.

HTH

-- jay
--
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.dpguru.com  http://www.engatiki.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




escaping @

2005-07-18 Thread Charles Farinella
I'm sure this is very simple and I am overlooking something.  I want to
read a list of bad email addresses from a file and remove them from my
database.  

If I print $_, the email addresses are correct, if I try to remove them
from the db I get errors on just the characters before the @.

Here is what I have:

==
#!/usr/bin/perl -w

use strict;
use DBI;
use DBD::Pg;

my $infile = $ARGV[0];


open( INFILE, "<$infile" );
while(  ) {
my $dbh = DBI->connect("dbi:Pg:dbname=*, "*", "*") || die;

#s/\@/\\@/;
#print $_;

my $sth = $dbh->prepare("UPDATE
table
SET
email = ''
WHERE
email = $_ ") || die;

$sth->execute;

finish $sth;
$dbh->disconnect;
}

close( INFILE );
==

-- 
Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
603.924.6079


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Usage of defaultvariable @_ with shift

2005-07-18 Thread Xavier Noria

On Jul 18, 2005, at 10:57, Mathias Pasquay wrote:

Now i change the line "my $test = shift @_" into "my $test =  
shift". This should work because shift should use @_ by default.
But in this case $test is empty an the second print command prints  
still the whole @_.


Have a look at perldoc -f shift, its default depends on where it is  
used.


-- fxn

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Usage of defaultvariable @_ with shift

2005-07-18 Thread Mathias Pasquay
Dear list,


i'am just wondering about the behaviour of shift and the defaultvariable @_ .

I use the following code::

while () { # each line of RULEFILE is stored in $_
chomp;# delete \n from $_
split /;/;   # split the fields of $_ seperated 
by ; into @_
print "Array before shift: @_\n"; # prints @_  
my $test = shift @_;# $test gets the first 
item from @_
print "Array after shift: @_\n";#  print @_ without the 
first item
}   

everything works fine.

Now i change the line "my $test = shift @_" into "my $test = shift". This 
should work because shift should use @_ by default.
But in this case $test is empty an the second print command prints still the 
whole @_.

I really don't know why this should not work?

I would be happy about any help.

Greetings
Mathias  





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]