win32::File

2002-11-07 Thread Mark Goland
Hi all,

I am trying to do directory traversal on NTFS. When I test fileif its a
directory or a regular file. It does not seem to work. -d anf -f test's dont
seem to work as well. Can someone please look over my error.

Thankx in advance, Mark

#!c:\perl\bin\perl -w
use Win32::File ;


&my_trav('.');

sub my_trav(){

$DIRNAME.=$_[0];
print "in dir $DIRNAME\n";

opendir DIR,$DIRNAME;
@dir=readdir DIR;


foreach $Val(@dir){

Win32::File::GetAttributes("$Val", $attr);

print "Direcotry:\t$Val\tattrib=$attr\n" if ( $attr & DIRECTORY);
print "File:\t$Val\tattrib=$attr\n" if ( $attr & NORMAL);
}


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




Re: command help using open/backticks

2002-11-07 Thread Steve Grazzini
Nikola Janceski <[EMAIL PROTECTED]> wrote:
>>
>> is there a way to use the PROGRAM LIST format for backticks 
>> or open the same way you can for exec and system?
>
> I have found one work around, but I was hoping there would be 
> some other way..
> 
> perhaps this suggestion can make it into Perl 6?
> 
> current work around:
> perldoc perlipc
> search for "execute something without the shell's interference"

If you're talking about the 5.8 perlipc, then that's the only way
to do it, AFAIK.  

But in case you haven't seen this yet, it's at least nicer than
the old work-around:

  require 5.008;
  sub my_readpipe {
open my $fh, '-|', @_;
<$fh>
  }

-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m("(.*)")'

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




RE: Securing/Encrypting Source

2002-11-07 Thread Sumit_Babu

You can also look at PAR... http://www.autrijus.org/par-intro/

Sumit.
<<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>>

We cannot become what we need to be by remaining what we are.

<<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>> <<<>>>



   
   
Toby Stuart
   
   
ys.com.au>  cc:
   
Subject: RE: Securing/Encrypting 
Source   
08-11-2002 09:42 AM
   
   
   
   
   




how about the poor mans way ... Acme::Bleach

> -Original Message-
> From: Timothy Johnson [mailto:tjohnson@;sandisk.com]
> Sent: Friday, November 08, 2002 11:05 AM
> To: 'dan'; [EMAIL PROTECTED]
> Subject: RE: Securing/Encrypting Source
>
>
>
> If you just want to make it harder, you can try "compiling"
> it with PerlApp
> from ActiveState.  Bear in mind, this will not make it
> impossible to see
> your source, but it will make it difficult, since the source
> IS visible in
> memory while your scripts are executing.
>
> -Original Message-
> From: dan [mailto:mail@;danneh.demon.co.uk]
> Sent: Friday, November 08, 2002 11:13 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Securing/Encrypting Source
>
>
> so if perlcc is not a good way to compile your perl source
> for *nix systems,
> then what is?
>
> dan
>
> "Paul Johnson" <[EMAIL PROTECTED]> wrote in message
> news:20021107205443.GA4209@;pjcj.net...
> > On Thu, Nov 07, 2002 at 03:08:23PM -, dan wrote:
> >
> > > answering my own question, i read back the newsgroup a
> little, and came
> > > across an article about perlcc. i tried this..
> > > perlcc -o output input.pl
> > > however, since my program uses DBI, the end compiled
> program reads:
> > >
> > > Connecting to SQL...
> > > Undefined subroutine &DBI::dr::connect called at
> > > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 503.
> > > Undefined subroutine &DBI::dr::disconnect_all called at
> > > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 565.
> > > END failed--call queue aborted.
> > >
> > > any ideas how i may be able to come over this?
> >
> > Two.
> >
> > 1. Forget you ever heard about perlcc.
> > 2. Prepare for some heavy duty hacking.
> >
> > perlcc is experimental, incomplete and buggy and that looks
> unlikely to
> > change in the near future.
> >
> > --
> > Paul Johnson - [EMAIL PROTECTED]
> > http://www.pjcj.net
>
>
>
> --
> 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]
>

--
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]




Streaming data into Postgresql

2002-11-07 Thread Kevin Old
Hello, I need help with the code below. It all works and the data is
streamed into the database, but it takes a long time. I'm dealing with
60,000+ records that are being pulled from a continuous growing text
file (that stops after the hour of data is collected). I just want to
see if anyone has suggestions on improving my code. cdlPg.pm 


package cdlPg;

use lib '/export/home/motodev/bin/';
use DBI;
#use DBD::mysql;
use DBD::Pg;
use Benchmark;
use IO::File;
use CDMAConfig;

sub new {
my $class = $_[0];
my $objref = {
_mkt=> $_[1],
_srvr=> $_[2],
_db=> $_[3],
_st=> $_[4],
_et=> $_[5],
_ed=> $_[6],
_file=> $_[7],
_tbl=> $_[8],
_release=> $_[9],
_fstopn => $_[10],
};
bless $objref, $class;
return $objref;

}#end new
sub print_me {
my ($self) = @_;
print "mkt: $self->{_mkt}\n";
print "srvr: $self->{_srvr}\n";
print "db: $self->{_db}\n";
print "st: $self->{_st}\n";
print "et: $self->{_et}\n";
print "ed: $self->{_ed}\n";
print "file: $self->{_file}\n";
print "table: $self->{_tbl}\n";
print "release: $self->{_release}\n";
print "dbh: $self->{_dbh}\n";
my $dbh = $self->{_dbh};
#my $sth = $self->{_sth};
%ENV = %CDMAConfig::MOTOENV;
#open(FHD, ">$self->{_file}");
open(WRITEME, "| /export/home/motorola/local/postgresql7.2.3/bin/psql 
+-d $self->{_db} -U kevin -c 'COPY $self->{_tbl} FROM stdin' ") or die
+ "Couln't fork: $! \n";

#$dbh->trace(2);
#$sql = "INSERT INTO $self->{_tbl} VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,
+?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?
+,?,?,?,?,?,?)";
$sql = "SELECT nextval('" . $self->{_tbl} . "_id_seq')";
$sth = $dbh->prepare($sql);
$loop_time=new Benchmark;


while( @kolines = readany( @{$self->{_fstopn}} ) ) {
$number++

foreach my $theline (@kolines) {
if($ver == 16) {

@line = (split(/\|/, $theline))[0,4,5,6,9,10,11,14,18,
+19,21,22,23,25,26,27,28,29,30,31,32,33,34,35,36,37,254,257,258,259,26
+4,265,266,271,272,273,299,300,301,306,307,308,313,314,315,397,398,399
+,400,403,404,406,407,408,409];

} else {

@line = (split(/\|/, $theline))[0,4,5,6,9,10,11,14,18,19,2
+1,22,23,25,26,27,28,29,30,31,32,33,34,35,36,37,211,213,214,215,218,21
+9,220,223,224,225,243,244,245,248,249,250,253,254,255,317,318,319,320
+,322,323,325,326,327,328];

}


if($line[0] eq "")
{
#print "8 is: $line[8]";
$line[0] = '0001-01-01';
}

if($line[8] eq "")
{
#print "8 is: $line[8]";
$line[8] = '00:00:00';
}

if($line[25] eq "")
{
#print "25 is: $line[25]";
$line[25] = '00:00:00';
}
#print join(", ", @line);
$sth->execute;
@rv = $sth->fetchrow_array;
print WRITEME join("\t", @line,$rv[0]) . "\n";
#$dbh->commit();
#($number % 5) == 0 ? $dbh->commit() : next;
}#end foreach
}#end while
close(WRITEME);
$end_time=new Benchmark;
open(KOOUT, ">>/export/home/motodev/kobench.txt");
print KOOUT "$self->{_tbl} the code took: " .  timestr(timediff($end_t
+ime, $loop_time),"all") . "\n\n";
close(KOOUT);

$sth->finish();
$dbh->disconnect();
}

sub readany {
my $cnt = 0;
my @res;

for my $fh ( @_ ) {
next if eof($fh);
my $line = <$fh>;
$cnt++ if defined($line);
push @res, $line;
}

return if ! $cnt;
return @res;

}#end readany

sub getData {
my ($self) = @_;

my @files = @{$self->{_fstopn}};

foreach my $file (@files) {
local *FILE;
open(FILE, "<$file") or die "can't open file $!\n";
push(@filehandles, *FILE);

}

$self->{_fstopn} = \@filehandles;

&print_me;
}

# Establish the connection and create the table for this data - return
+ database connection with prepared statement
sub connectDB {
my ($self) = @_;

$dbh = DBI->connect("DBI:Pg:dbname=$self->{_db};host=se-srvr1;port
+=5432", 'kevin', 'passwordhere', { RaiseError => 1, AutoCommit => 0 }
+);


$dbh->do("CREATE TABLE $self->{_tbl} (
date date DEFAULT '0001-01-01',
cdl_seq_num int4 DEFAULT 0,
call_ref_num int4 DEFAULT 0,
cbsc int4 DEFAULT 0,
cpp int4,
mid char(10),
esn int8 DEFAULT 0,
dialed_digits char(32),
access_time time DEFAULT '00:00:00',
access_pn_offset int4,
access_channel int4,
access_bts int4 DEFAULT '0',
access_sector int4,
service_option int4,
negotiated_so int4,
last_mm_setup_event int4,
cic_span int4,
cic_slot int4,
xcdr int4,
init_rf_conn_bts int4,
init_rf_conn_sector int4,
init_rf_conn_mcc int4,
init_rf_conn_element int4,
init_rf_conn_channel int4,
cfc int4,
release_time time DEFAULT '00:00:00',
last_maho_cand_count int4,
last_

RE: Securing/Encrypting Source

2002-11-07 Thread Toby Stuart
how about the poor mans way ... Acme::Bleach

> -Original Message-
> From: Timothy Johnson [mailto:tjohnson@;sandisk.com]
> Sent: Friday, November 08, 2002 11:05 AM
> To: 'dan'; [EMAIL PROTECTED]
> Subject: RE: Securing/Encrypting Source
> 
> 
> 
> If you just want to make it harder, you can try "compiling" 
> it with PerlApp
> from ActiveState.  Bear in mind, this will not make it 
> impossible to see
> your source, but it will make it difficult, since the source 
> IS visible in
> memory while your scripts are executing.
> 
> -Original Message-
> From: dan [mailto:mail@;danneh.demon.co.uk]
> Sent: Friday, November 08, 2002 11:13 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Securing/Encrypting Source
> 
> 
> so if perlcc is not a good way to compile your perl source 
> for *nix systems,
> then what is?
> 
> dan
> 
> "Paul Johnson" <[EMAIL PROTECTED]> wrote in message
> news:20021107205443.GA4209@;pjcj.net...
> > On Thu, Nov 07, 2002 at 03:08:23PM -, dan wrote:
> >
> > > answering my own question, i read back the newsgroup a 
> little, and came
> > > across an article about perlcc. i tried this..
> > > perlcc -o output input.pl
> > > however, since my program uses DBI, the end compiled 
> program reads:
> > >
> > > Connecting to SQL...
> > > Undefined subroutine &DBI::dr::connect called at
> > > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 503.
> > > Undefined subroutine &DBI::dr::disconnect_all called at
> > > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 565.
> > > END failed--call queue aborted.
> > >
> > > any ideas how i may be able to come over this?
> >
> > Two.
> >
> > 1. Forget you ever heard about perlcc.
> > 2. Prepare for some heavy duty hacking.
> >
> > perlcc is experimental, incomplete and buggy and that looks 
> unlikely to
> > change in the near future.
> >
> > --
> > Paul Johnson - [EMAIL PROTECTED]
> > http://www.pjcj.net
> 
> 
> 
> -- 
> 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]
> 

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




Re: Securing/Encrypting Source

2002-11-07 Thread Todd W
[message rearranged because of jeopardy style posting]


"Paul Johnson" <[EMAIL PROTECTED]> wrote in message
news:20021107205443.GA4209@;pjcj.net...


On Thu, Nov 07, 2002 at 03:08:23PM -, dan wrote:



answering my own question, i read back the newsgroup a little, and came
across an article about perlcc. i tried this..
perlcc -o output input.pl
however, since my program uses DBI, the end compiled program reads:

Connecting to SQL...
Undefined subroutine &DBI::dr::connect called at



any ideas how i may be able to come over this?


Two.

1. Forget you ever heard about perlcc.
2. Prepare for some heavy duty hacking.

perlcc is experimental, incomplete and buggy and that looks unlikely to
change in the near future.




Dan wrote:
> so if perlcc is not a good way to compile your perl source for *nix 
systems,
> then what is?
>
> dan

There isn't a good way to compile perl programs. If your program is that 
important, tell your isp you need a static ip address and set up your 
own web server. Where Im located, a static ip address with an ADSL 
internet connection is (somewhat) reasonably priced.

But what I did was got a machine set up at a company I consult for, so 
my cost was the box and the domain name registration.

Todd W.


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



Re: Population of variables in hash values...

2002-11-07 Thread Todd W


Tim Yohn wrote:

On Thu, 7 Nov 2002 11:04:26 -0800 
Timothy Johnson <[EMAIL PROTECTED]> wrote:


It sounds like the eval solution proposed earlier is exactly what
you're looking for then.  You can just store the string in your hash
and eval it when you need to print.



Yup!  With a little reworking of how I'm calling everything that worked
like a charm.  Thanks for the help everyone!

Tim.


I dont understand the eval. Why do it when you dont need to:

[trwww@devel_rh trwww]$ perl -we 'use strict;my($d);my(%h) = (1 => 
\$d);$d="foo\n";print(${ $h{1} });'
foo

Store a reference to the scalar and dereference it when needed, as 
posted in another reply.

Todd W.


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



Need help to parse a message block

2002-11-07 Thread chris
I need some ideas for parsing a multi-line message block and reformat
into columnar output

1. message block is bound by a begin and end tags {begin} {end}
2. within the message blocks are tags for column data :1: :34:

sample message blocks with column data

{begin}
:1:some text 1
:34:1234,00
:33:text
with continuation
{end}
{begin}
:2:some text 2
:34:456,99
:33:text
{end}

reformat to csv

tag1,tag2,tag33,tag34
"some text 1",,"text with continuation".1234,00
,"some text 2","text".456,99

I am considering parsing line by line with a structure like this
pseudo code

look for begin tag
if defined begin tag{
look for a tag until end tag found or no more
  if defined tag{
is it tag 1()
is it tag 2()
is it tag 33()
is it tag 34()  
is it end tag(write csv)  
  }
}



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




RE: Declaring a Hash

2002-11-07 Thread Peter Scott
In article ,
 [EMAIL PROTECTED] (Timothy Johnson) writes:
>
>As far as I know, the #1 reason why people declare data structures
>explicitly is to avoid "uninitialized" messages while using warnings.

For scalars, sure, although the only time I really find that valid is
in a case like

my $whatzit = '';
for (@fuzzbar) { $whatzit .= friggle($_) }

It has nothing to do with hashes, which is the subject of the question.

>-Original Message-
>From: [EMAIL PROTECTED] [mailto:peter@;psdt.com]
>Sent: Thursday, November 07, 2002 5:11 PM
>To: [EMAIL PROTECTED]
>Subject: RE: Declaring a Hash
>
>
>In article
><[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Colin Johnstone) writes:
>>Here is how you declare hash.
>>
>>my %hash = ();
>
>The "= ()" is entirely redundant.  Just "my %hash" does exactly the same
>thing.
>
>-- 
>Peter Scott

-- 
Peter Scott
http://www.perldebugged.com

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




RE: Hash Sorting?

2002-11-07 Thread Timothy Johnson

No, you're right.  It all depends on what the poster wanted to do with the
information after they got it.  If they just want a list of the values
sorted, then sorting on "values %hash" would work.  They said they wanted to
sort the hash by the values, and that's why I assumed that they still wanted
to be able to associate the values to the keys after sorting.  Otherwise
your only choice is to iterate through the keys for each value until you
find one that matches.

-Original Message-
From: david [mailto:dzhuo@;looksmart.net]
Sent: Thursday, November 07, 2002 5:10 PM
To: [EMAIL PROTECTED]
Subject: RE: Hash Sorting?


Timothy Johnson wrote:

> 
> I guess it depends on whether you want the list of keys sorted by which
> has
> the highest value or the values themselves.  The most common use of this
> for me is when I want to sort the keys or values of a hash using a hash
> reference, for example if I'm calculating people's final scores for a
> scoreboard.  The values would be useless sorted if I didn't know which key
> they went to.  Take the following example, where just to mix things up a
> little, I've passed a hash reference to my function:
> 

didn't the original poster said the values are unique too? and he said (in 
particular) that he wants to sort the values right?

anyway, i just happen to be surfing around but didn't really read your 
previous post so i could be wrong... :-) if that's the case, ignore me...

david

-- 
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: Declaring a Hash

2002-11-07 Thread Timothy Johnson

As far as I know, the #1 reason why people declare data structures
explicitly is to avoid "uninitialized" messages while using warnings.

-Original Message-
From: [EMAIL PROTECTED] [mailto:peter@;psdt.com]
Sent: Thursday, November 07, 2002 5:11 PM
To: [EMAIL PROTECTED]
Subject: RE: Declaring a Hash


In article
<[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Colin Johnstone) writes:
>Here is how you declare hash.
>
>my %hash = ();

The "= ()" is entirely redundant.  Just "my %hash" does exactly the same
thing.

-- 
Peter Scott
http://www.perldebugged.com

-- 
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: Strange behaviour

2002-11-07 Thread david
Jessee Parker wrote:

> I am currently running this on Redhat Linux version 7.3 and using Perl
> version 5.8.0. I've tried different things - let the process run and
> process multiple batches of files and I have killed it with kill -9
> command on the pid and then restarted the program. First run is always
> good - it sends out the information correctly. Second run it prints to the
> screen that it is in the send portion of the program and is looping
> correctly but in fact, no data is sent out and the data is not deleted
> from the mysql database. I'll take a look at the link and try removing the
> SIG{CHLD} to see if that is of any help.
> 
> Jessee

to be honest, your problem seems like a totally different one. i will give 
your script another visit. do you have any idea of where your problem might 
be? just so that i don't have to read your whole script... :-)

david

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




Re: Pattern matching - external website

2002-11-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Eric Ellsworth) writes:
>Right now the regexp I'm using is:
>
>   /http:\/\/([^(\w*?\.?mysite\.com)]*)\//i
>
>but it does not match something it should, i.e.,
>
>   http://www.reuters.com/otherstuff.
>
>Where am I going wrong?

perldoc perlre

[^(\w*?\.?mysite\.com)]

means "a character which is not in the set of
left parenthesis
word characters (a-zA-Z0-9_)
question mark
period
right parenthesis

The question mark and period are repeated and the letters m,y,s,i,t,e,c,o,m are
redundant with the \w.

You need to understand character classes.

-- 
Peter Scott
http://www.perldebugged.com

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




Re: Strange behaviour

2002-11-07 Thread Jessee Parker
I am currently running this on Redhat Linux version 7.3 and using Perl
version 5.8.0. I've tried different things - let the process run and process
multiple batches of files and I have killed it with kill -9 command on the
pid and then restarted the program. First run is always good - it sends out
the information correctly. Second run it prints to the screen that it is in
the send portion of the program and is looping correctly but in fact, no
data is sent out and the data is not deleted from the mysql database. I'll
take a look at the link and try removing the SIG{CHLD} to see if that is of
any help.

Jessee
- Original Message -
From: "david" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 5:02 PM
Subject: Re: Strange behaviour


> Jessee Parker wrote:
>
> > Hi all,
> >
> > I have a script that basically waits for 2 files to be delivered to
> > it,
> > then it processes the 2 files, inserts them into the database and then
> > starts sending information. After information is sent, it deletes the
> > record from the database and increments a counter. I do a fork in the
> > subroutine that does the sending / deleting portion. What I've come to
> > notice is that if I do this once, it sends everything fine and the data
is
> > correctly erased from the database. The next time I do this, it runs,
> > doesn't complain about any errors but it doesn't do the send and it
> > doesn't perform the delete. Here is the sending portion of the co
>
> Are you running this in UNIX? whar version of Perl you have?
> There is a well-known bug when using fork in Perl under UNIX. check this
> out:
>
> http://archive.develooper.com/perl5-porters@;perl.org/msg87476.html
>
> the bug had been reported to the Perl bug list. if you know how to use
truss
> in UNIX, run your script through truss but don't trace fork and child
> execution, you will see a bunch of setContext() calls that Perl calls when
> you fork, if you do a man setContext(), you will know why this can be a
> problem. what happen is that Perl resets all process-wide static variable
> in the parent process so the behavior is very odd in the parent...
>
> someone suggest to remove the $SIG{CHLD} hanlder (if you have one) and see
> if it solve the problem or not. i haven't try this myself.
>
> this appears to be only affect UNIX machine(ie, BSD or Linux seems to be
> ok.) But i have seen very similar situation in RH8 as well...
>
> since i didn't read through your whole script, your problem might be
totally
> different but it's something you should keep an open eye on...
>
> david
>
> --
> 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: Declaring a Hash

2002-11-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Colin Johnstone) writes:
>Here is how you declare hash.
>
>my %hash = ();

The "= ()" is entirely redundant.  Just "my %hash" does exactly the same
thing.

-- 
Peter Scott
http://www.perldebugged.com

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




Re: die not working

2002-11-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Colin Johnstone) writes:
>Gidday all,
>
>I assume when using die in this format I should see the error message.
>
>#!/usr/bin/perl
>
>use CGI qw( :standard );
>
>print header();
>$file1 = /web/schooled/www/news/subscribers_news1.txt
>
>open IN, "<$file1" or die("Cannot Open: $!");
>while( my $record =  ){
>  chomp $record;
>  @data = split( /\|/, $record);
>  $subscribers1{$data[0]} = $data[1];
>}
>close IN;
>
>The program dies but no error prints on the screen.
>
>Where am I going wrong?

Many places, unfortunately.

You don't enable warnings or strictness.  You have at least two syntax
errors in the program (the line assigning to $file1 is not terminated with
a semicolon and there are no quotes around the string).  You don't say 
how you know the program died (when it shouldn't have run at all).  
This appears to be a CGI program yet it does not produce any output after
the header at all.  And you don't say whether you expect to see the error
in the browser or in the server error log file (where it appears depends
on which web server you're using).

Put these lines

use strict;
use warnings;

after your first line.  When you've got the program to run properly from 
the command line, you should be closer to getting it to work over the
web.  Make sure you read "Learning Perl" 3rd ed (Schwartz & Phoenix) and
at least one book about CGI programming (e.g., "CGI Programming with Perl",
Meltzer & Michalski).

-- 
Peter Scott
http://www.perldebugged.com

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




RE: Hash Sorting?

2002-11-07 Thread david
Timothy Johnson wrote:

> 
> I guess it depends on whether you want the list of keys sorted by which
> has
> the highest value or the values themselves.  The most common use of this
> for me is when I want to sort the keys or values of a hash using a hash
> reference, for example if I'm calculating people's final scores for a
> scoreboard.  The values would be useless sorted if I didn't know which key
> they went to.  Take the following example, where just to mix things up a
> little, I've passed a hash reference to my function:
> 

didn't the original poster said the values are unique too? and he said (in 
particular) that he wants to sort the values right?

anyway, i just happen to be surfing around but didn't really read your 
previous post so i could be wrong... :-) if that's the case, ignore me...

david

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




Re: Strange behaviour

2002-11-07 Thread david
Jessee Parker wrote:

> Hi all,
> 
> I have a script that basically waits for 2 files to be delivered to
> it,
> then it processes the 2 files, inserts them into the database and then
> starts sending information. After information is sent, it deletes the
> record from the database and increments a counter. I do a fork in the
> subroutine that does the sending / deleting portion. What I've come to
> notice is that if I do this once, it sends everything fine and the data is
> correctly erased from the database. The next time I do this, it runs,
> doesn't complain about any errors but it doesn't do the send and it
> doesn't perform the delete. Here is the sending portion of the co

Are you running this in UNIX? whar version of Perl you have?
There is a well-known bug when using fork in Perl under UNIX. check this 
out:

http://archive.develooper.com/perl5-porters@;perl.org/msg87476.html

the bug had been reported to the Perl bug list. if you know how to use truss 
in UNIX, run your script through truss but don't trace fork and child 
execution, you will see a bunch of setContext() calls that Perl calls when 
you fork, if you do a man setContext(), you will know why this can be a 
problem. what happen is that Perl resets all process-wide static variable
in the parent process so the behavior is very odd in the parent...

someone suggest to remove the $SIG{CHLD} hanlder (if you have one) and see 
if it solve the problem or not. i haven't try this myself.

this appears to be only affect UNIX machine(ie, BSD or Linux seems to be 
ok.) But i have seen very similar situation in RH8 as well...

since i didn't read through your whole script, your problem might be totally 
different but it's something you should keep an open eye on...

david

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




Re: Fw: Congratulations List Members!

2002-11-07 Thread Wiggins d'Anconia
behold the power of open source..

http://danconia.org

Fred A. Romani wrote:

- Original Message -
From: Fred A. Romani
Sent: Thursday, November 07, 2002 1:22 PM
To: [EMAIL PROTECTED]
Subject: Congratulations List Members!

My background is Math, Sciences and Engineering. I like numbers. Because of that, sometimes I undertake little projects that, although not earthshaking in terms of importance by themselves, are frequently illustrative, and may be significant for some people.

Postings in the Perl Beginners List are routinely given a number. The highest number I have found today, as of the time of this writing, is 36677. Exactly one year ago, on November 7, 2001, the highest posting number was 462. That means 36215 inquiries and discussions have been posted in one year. That is remarkable. Almost 100 postings a day for every one of the last 365 days.


From the above, it is clear that the Perl group members are very intellectually active and inquisitive. During the last year I have witnessed the very large number of topics examined, and I get the impression that Perl people do not leave any stone unturned when it comes to discussing the pros, cons, and details of a given Perl subject. You members of the List deserve to be congratulated for your dedication, and the loyalty to your specialized knowledge that you display on a daily basis.


I should also express my recognition to the relatively small core of specialists, those "old timers" in terms of experience in the Perl specialty, who day after day have reached out to the newer members, to help them with the wisdom they acquired through years of practice in the specialty, "in the trenches". Thank you guys. Please, keep it up.

Finally, let me ask everyone in the List not to forget that the group was formed to help Perl beginners. The group actually has that name. Please always treat every question as an important one, no matter how simplistic it mat seem. Remember that there is no such a thing as an stupid question.

May you live brighter and stronger for many years to come.




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




RE: Hash Sorting?

2002-11-07 Thread Timothy Johnson

I guess it depends on whether you want the list of keys sorted by which has
the highest value or the values themselves.  The most common use of this for
me is when I want to sort the keys or values of a hash using a hash
reference, for example if I'm calculating people's final scores for a
scoreboard.  The values would be useless sorted if I didn't know which key
they went to.  Take the following example, where just to mix things up a
little, I've passed a hash reference to my function:

my %hash = (foo => 24, monkey => 45, kilgore => 69, buttons => 36);
PrintScores(\%hash);

sub PrintScores{
  my $ref = $_[0]; #$ref is now a reference to %hash
  my @sorted_keys = sort{ $ref->{$b} <=> $ref->{$a} } keys %{$ref};
  print "TOP SCORES OF THE DAY\n";
  print "=\n";
  foreach(@sorted_keys){
print "$_ => $ref->{$_}\n";
  }
}

-Original Message-
From: david [mailto:dzhuo@;looksmart.net]
Sent: Thursday, November 07, 2002 4:25 PM
To: [EMAIL PROTECTED]
Subject: Re: Hash Sorting?


Kurtis wrote:

> Hey Timothy,
> 
>   I couldn't get it to work...I know you can sort on keys, so I went
>   out
> the cheap wayI switched the values with my keys...it's no problem
> because my values are unique also
> 

why not just sort on the values?

foreach my $value (sort {$a <=> $b} values %hash){
print "$value\n";
}

david

-- 
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: Hash Sorting?

2002-11-07 Thread david
Kurtis wrote:

> Hey Timothy,
> 
>   I couldn't get it to work...I know you can sort on keys, so I went
>   out
> the cheap wayI switched the values with my keys...it's no problem
> because my values are unique also
> 

why not just sort on the values?

foreach my $value (sort {$a <=> $b} values %hash){
print "$value\n";
}

david

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




RE: Securing/Encrypting Source

2002-11-07 Thread Timothy Johnson

If you just want to make it harder, you can try "compiling" it with PerlApp
from ActiveState.  Bear in mind, this will not make it impossible to see
your source, but it will make it difficult, since the source IS visible in
memory while your scripts are executing.

-Original Message-
From: dan [mailto:mail@;danneh.demon.co.uk]
Sent: Friday, November 08, 2002 11:13 AM
To: [EMAIL PROTECTED]
Subject: Re: Securing/Encrypting Source


so if perlcc is not a good way to compile your perl source for *nix systems,
then what is?

dan

"Paul Johnson" <[EMAIL PROTECTED]> wrote in message
news:20021107205443.GA4209@;pjcj.net...
> On Thu, Nov 07, 2002 at 03:08:23PM -, dan wrote:
>
> > answering my own question, i read back the newsgroup a little, and came
> > across an article about perlcc. i tried this..
> > perlcc -o output input.pl
> > however, since my program uses DBI, the end compiled program reads:
> >
> > Connecting to SQL...
> > Undefined subroutine &DBI::dr::connect called at
> > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 503.
> > Undefined subroutine &DBI::dr::disconnect_all called at
> > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 565.
> > END failed--call queue aborted.
> >
> > any ideas how i may be able to come over this?
>
> Two.
>
> 1. Forget you ever heard about perlcc.
> 2. Prepare for some heavy duty hacking.
>
> perlcc is experimental, incomplete and buggy and that looks unlikely to
> change in the near future.
>
> --
> Paul Johnson - [EMAIL PROTECTED]
> http://www.pjcj.net



-- 
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: Data extraction from text file (overwhelmed newbie) (0/1)

2002-11-07 Thread Philip Neukom
On Thu, 07 Nov 2002 12:25:12 -0800, [EMAIL PROTECTED] (John W. Krahn) wrote:

Thank you very much John.

>> My file is ~350MB. (not attached of course)
>> It has the structure as shown in the attachment [OrderSample.txt].
>> I have also attached an example of what the data should look like in
>> final form [OrderSampleFinished.txt].
>
>The two files in the other message aren't labeled and it isn't clear
>which is relevant ...
>
...
Sorry for the confusion.  There were 2 files attached. One showed the file that
I am trying to extract data from [OrderSample.txt].  This is transaction data
from an order processing system.

The second file is what I would like the output to look like so I can import
(tab delimited) into a database.  In this case I'll try MS Access unless it
cacks.
...
>> Each record spans 3 lines.
>> 
>> I am using ActivePerl.
>> 
>> #!c:\perl\perl -n
>> 
>> use strict;
>> 
>> while(/^Customer\:[ \t]+([\*\d+)[ \t]+(.+)/){
>> chomp;
>> my $customer = substr($_,2);
>> while(/^([\*\d+|\d+][ \t]+([\d+])[ \t]([\d{2}\/[\d{2}\/[\d{2})
>> ... select to end of third line)
>> my $order = substr($_,19)
>> while (<>){
>> next LINE if ($order(2) eq $order(2));
>> print "$customer$_" ""$order$_" > newfile.txt;
>> }
>> }
>> }
>> 
>> I'm not sure if while is going to work or if I should try to figure
>> out how to use foreach?
>
>If you don't know how to describe what you want to do in Perl, try to
>describe it in English.
...
OK, I will try in English
I want to extract all the transactional data from the file and put into tab
delimited format so I can import into a database.

Each page has a header with the customer information.  Then there is a
description of the item purchased.  The item description shows up only at the
start of a list of orders for each customer.  Then there is the order
transaction data that shows the qty and date of the order plus some other info
but doesn't show the item number or description

I want to create a record for each order which has the customer info, item info
and order info.

So in psydo code;

Open  the file "file.txt"


if line starts with "Customer"
then capture and store "Customer Number" and "Customer Name"
increment to next line and do ItemNumberCapture for all items and orders
else
increment to next line
endIf

ItemNumberCapture
if line begins with "Item Number" and contains "Item Descriptions"
then capture and store "Item number" "item descriptions" and rest of "3
line item record"
write record to external file
increment to next line
else#for lines that only have order data
capture and store order transaction data
write record to external file
endIf

I hope this makes sense
Philip

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




Re: Securing/Encrypting Source

2002-11-07 Thread dan
so if perlcc is not a good way to compile your perl source for *nix systems,
then what is?

dan

"Paul Johnson" <[EMAIL PROTECTED]> wrote in message
news:20021107205443.GA4209@;pjcj.net...
> On Thu, Nov 07, 2002 at 03:08:23PM -, dan wrote:
>
> > answering my own question, i read back the newsgroup a little, and came
> > across an article about perlcc. i tried this..
> > perlcc -o output input.pl
> > however, since my program uses DBI, the end compiled program reads:
> >
> > Connecting to SQL...
> > Undefined subroutine &DBI::dr::connect called at
> > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 503.
> > Undefined subroutine &DBI::dr::disconnect_all called at
> > /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 565.
> > END failed--call queue aborted.
> >
> > any ideas how i may be able to come over this?
>
> Two.
>
> 1. Forget you ever heard about perlcc.
> 2. Prepare for some heavy duty hacking.
>
> perlcc is experimental, incomplete and buggy and that looks unlikely to
> change in the near future.
>
> --
> Paul Johnson - [EMAIL PROTECTED]
> http://www.pjcj.net



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




Pattern matching - external website

2002-11-07 Thread Eric Ellsworth
Hi, I'm writing a program that parses through existing files on a website and
converts links to be rerouted through another program.

I'd like to skip external websites, and I'm having a bear of a time with the
matching string.  Specifically, what I'd like to do is match any url that
includes:

http://something_or_nothing.somedomain.com/

(it can have other stuff after the last slash) but does not include:

mysite.com

in the host part if the url.  It must contain http:// to distinguish internal
from external links

Right now the regexp I'm using is:

/http:\/\/([^(\w*?\.?mysite\.com)]*)\//i

but it does not match something it should, i.e.,

http://www.reuters.com/otherstuff.

Where am I going wrong?Any ideas or advice would be much appreciated.

Thanks,

EE


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




RE: What driver to use with DBI for access 97

2002-11-07 Thread ss004b3324
Hi Chris,

> Just getting started trying to pull some data from a fairly simple access
> 97 database.  What driver do I need to use to connect in this string..
> 
> my $dbh = DBI->connect('DBI:?:framestats.mdb');
Connecting to an Access database on my box:
my $dbh = DBI->connect( "dbi:ODBC:StudentDB", "", "",
   {RaiseError => 1, PrintError => 1, AutoCommit => 1} ) or
   die "Unable to connect: " . $DBI::errstr . "\n";

This is using a DSN called StudentDB.

Hth,

Shaun
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.413 / Virus Database: 232 - Release Date: 06/11/2002


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




perl libnet problem in AXI 5.1

2002-11-07 Thread Cesar Delgado
Hi, i'm having problems with a perl 5.0.6 program in AIX 5.1

the message error is

 Can't locate object method "new" via package "Net::FTP" at 
/opt/adm/bin/transfer_unix line 33

i have already installed the package perl.libnet 1.7.3.0, but i'm still 
having the same problem, 

is there any newer libnet package for perl ???

any ideas ???

Thanks in advanced

Saludos, Cesar D. Delgado P.
IBM de Venezuela
T/L 777-8904777-8794
mailto:cdelgado@;ve.ibm.com

sts:[EMAIL PROTECTED]/

Be liberal in what you accept,
and conservative in what you send


Fw: Congratulations List Members!

2002-11-07 Thread Fred A. Romani
- Original Message -
From: Fred A. Romani
Sent: Thursday, November 07, 2002 1:22 PM
To: [EMAIL PROTECTED]
Subject: Congratulations List Members!

My background is Math, Sciences and Engineering. I like numbers. Because of that, 
sometimes I undertake little projects that, although not earthshaking in terms of 
importance by themselves, are frequently illustrative, and may be significant for some 
people.

Postings in the Perl Beginners List are routinely given a number. The highest number I 
have found today, as of the time of this writing, is 36677. Exactly one year ago, on 
November 7, 2001, the highest posting number was 462. That means 36215 inquiries and 
discussions have been posted in one year. That is remarkable. Almost 100 postings a 
day for every one of the last 365 days.

>From the above, it is clear that the Perl group members are very intellectually 
>active and inquisitive. During the last year I have witnessed the very large number 
>of topics examined, and I get the impression that Perl people do not leave any stone 
>unturned when it comes to discussing the pros, cons, and details of a given Perl 
>subject. You members of the List deserve to be congratulated for your dedication, and 
>the loyalty to your specialized knowledge that you display on a daily basis.

I should also express my recognition to the relatively small core of specialists, 
those "old timers" in terms of experience in the Perl specialty, who day after day 
have reached out to the newer members, to help them with the wisdom they acquired 
through years of practice in the specialty, "in the trenches". Thank you guys. Please, 
keep it up.

Finally, let me ask everyone in the List not to forget that the group was formed to 
help Perl beginners. The group actually has that name. Please always treat every 
question as an important one, no matter how simplistic it mat seem. Remember that 
there is no such a thing as an stupid question.

May you live brighter and stronger for many years to come.



RE: What driver to use with DBI for access 97

2002-11-07 Thread Beau E. Cox
Hi-

I have used ODBC - works well. Post again if you
need samples/help setting up ODBC.

Aloha => Beau.

-Original Message-
From: Chris Benco [mailto:Chris.Benco@;austinpowder.com]
Sent: Thursday, November 07, 2002 7:08 AM
To: [EMAIL PROTECTED]
Subject: What driver to use with DBI for access 97


Just getting started trying to pull some data from a fairly simple access
97 database.  What driver do I need to use to connect in this string..

my $dbh = DBI->connect('DBI:?:framestats.mdb');

I just need to pull a few bits and pieces of data out of this database for
use in another script.  Nothing overly complicated.

Chris Benco
[EMAIL PROTECTED]




-- 
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]




CPAN via Email

2002-11-07 Thread Beau E. Cox
Hi folks,

CPAN VIA EMAIL IS BACK ON THE AIR!

This past weekend my main server's hard drive melted down...
After many sleepless days and nights, she is alive and
well (of course, I had to upgrade to the latest SuSE 8.1,
and, boy, that led to problem after problem - please
email me if you are planning this move!)

Along with my brand new server, CPAN via email is back on
the air! For those of you new to these lists, or who haven't
heard of this service, here is a snippet from my original
announcement:

> Have you ever been at a customers' site and
> found out the Perl module you thought
> _everyone_ had on their system wasn't?
>
> OK, no sweat. Jump on the office manager's
> computer to download it from CPAN - oops -
> the sysadmin has installed a new firewall
> precluding web downloads/no one has ever
> downloaded anything before and who knows what
> the proxy server's IP is/the sysadmin just
> plain won't let you download the module for
> security reasons (and he sees you as a threat
> to his job).
>
> Well - say no more.
>
> This weekend I built CPAN via email (using
> XMail's message filtering/Jenda's Mail::Sender/
> etc.) You can SEARCH CPAN and DOWNLOAD modules
> via email.
>
> Please try it by sending a message with a blank
> subject line to:
>
> mailto:cpan@;beaucox.com
>
> Please let me know what you think. (Is anyone out
> there old enough to remember ftp-mail?)

In addition, I have added the "documentation" command
("d") which works like the "get" command but only 
returns the README (if present), Changes, and the
main HTML document.

COMING SOON: PPM's on demand. CPAN via email is being
modified to build and return PPD files; this service
is intended to help some of our compiler-challenged
Win32 friends!

Aloha => Beau.

PS: Jenda - I'm using Mail::Sender's 'keepconnected' -
so far so good!



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




Reading Emails sent to Server

2002-11-07 Thread Johnstone, Colin
Gidday All,
 
Im writing a double opt in newsletter subscription application. If I get sendmail to 
send an email to someone, can I write a program to read their replys to enable them to 
confirm their subscription automagically simply by replying to the email I sent them. 
Is this the standard practice.

Colin Johnstone 


 



Re: Securing/Encrypting Source

2002-11-07 Thread Paul Johnson
On Thu, Nov 07, 2002 at 03:08:23PM -, dan wrote:

> answering my own question, i read back the newsgroup a little, and came
> across an article about perlcc. i tried this..
> perlcc -o output input.pl
> however, since my program uses DBI, the end compiled program reads:
> 
> Connecting to SQL...
> Undefined subroutine &DBI::dr::connect called at
> /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 503.
> Undefined subroutine &DBI::dr::disconnect_all called at
> /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 565.
> END failed--call queue aborted.
> 
> any ideas how i may be able to come over this?

Two.

1. Forget you ever heard about perlcc.
2. Prepare for some heavy duty hacking.

perlcc is experimental, incomplete and buggy and that looks unlikely to
change in the near future.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

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




Re: Non valid emails

2002-11-07 Thread Kevin Meltzer
These requests should go to [EMAIL PROTECTED]

Cheers,
Kevin

On Thu, Nov 07, 2002 at 07:53:10AM -0800, Timothy Johnson ([EMAIL PROTECTED]) said 
something similar to:
>  
> I'd second that motion.  There are a few addresses that I would have
> submitted in the past if I had known where to send them...
> 
> -Original Message-
> From: dan
> To: [EMAIL PROTECTED]
> Sent: 11/7/02 5:26 AM
> Subject: Non valid emails
> 
> And another thing...
> 
> Is there some moderator or something of this board that can delete
> emails
> from the mailing list that haven't been used, or been retrievable, for a
> certain amount of time? I think it gets annoying when you post to the
> newsgroup, and then get a few Mailer Daemon responses saying the message
> couldn't be delivered to X people because of Y reason.
> 
> dan
> 
> 
> 
> -- 
> 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]

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Beauty is a French phonetic corruption of a short, cloth neck ornament,
currently in resurgence.
-- Frank Zappa

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




Re: auto ssh

2002-11-07 Thread Tanton Gibbs
http://search.cpan.org/author/IVAN/Net-SSH-0.07/SSH.pm
- Original Message - 
From: "Pravesh Biyani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 3:26 PM
Subject: auto ssh


> hi
>I am not sure if this question is suitable for this group. 
> Pardon me if its the wrong place.
> 
> Basically I want a perl script, which SSH to the remote machine, gives 
> the login, passwd  and executes command at the remote machine.
> 
> How do i do this?
> 
> Pravesh
> 
> 
> -- 
> 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]




auto ssh

2002-11-07 Thread Pravesh Biyani
hi
  I am not sure if this question is suitable for this group. 
Pardon me if its the wrong place.

Basically I want a perl script, which SSH to the remote machine, gives 
the login, passwd  and executes command at the remote machine.

How do i do this?

Pravesh


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



Re: Data extraction from text file (overwhelmed newbie) (0/1)

2002-11-07 Thread John W. Krahn
Philip Neukom wrote:
> 
> Hi!

Hello,

> I have a huge print file in txt format that I would like to extract
> data from, export to a new text file and then import into a database.
> I am less concerned about efficiency as I am with getting this done
> quick and dirty.

That's fine, that is one of the reasons Perl was created.

> I am just starting out and am confused as hell.  As the multitude of
> ways to do this run through my head I find I am getting no where.
> 
> Would some kind soul help this beginning beginer?

I would love to help, but ...

> My file is ~350MB. (not attached of course)
> It has the structure as shown in the attachment [OrderSample.txt].
> I have also attached an example of what the data should look like in
> final form [OrderSampleFinished.txt].

The two files in the other message aren't labeled and it isn't clear
which is relevant ...

> Each record spans 3 lines.
> 
> I am using ActivePerl.
> 
> #!c:\perl\perl -n
> 
> use strict;
> 
> while(/^Customer\:[ \t]+([\*\d+)[ \t]+(.+)/){
> chomp;
> my $customer = substr($_,2);
> while(/^([\*\d+|\d+][ \t]+([\d+])[ \t]([\d{2}\/[\d{2}\/[\d{2})
> ... select to end of third line)
> my $order = substr($_,19)
> while (<>){
> next LINE if ($order(2) eq $order(2));
> print "$customer$_" ""$order$_" > newfile.txt;
> }
> }
> }
> 
> I'm not sure if while is going to work or if I should try to figure
> out how to use foreach?

If you don't know how to describe what you want to do in Perl, try to
describe it in English.



John
-- 
use Perl;
program
fulfillment

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




Strange behaviour

2002-11-07 Thread Jessee Parker
Hi all,

I have a script that basically waits for 2 files to be delivered to it,
then it processes the 2 files, inserts them into the database and then
starts sending information. After information is sent, it deletes the record
from the database and increments a counter. I do a fork in the subroutine
that does the sending / deleting portion. What I've come to notice is that
if I do this once, it sends everything fine and the data is correctly erased
from the database. The next time I do this, it runs, doesn't complain about
any errors but it doesn't do the send and it doesn't perform the delete.
Here is the sending portion of the code:

sub Send_Mail
{
my @fields = ();
my $ServerName = "mail.dat-e-base.net";
my $retry_counter = 0;
my $sender = new Mail::Sender;

foreach $item (@_)
{
chomp;
push(@fields,$item);
}
$temp = scalar @fields;

### Get HTML ###
$html_message = "";
$query_html = "SELECT HTML_MESSAGE FROM broadcast where EMAIL_ID =
'$fields[9]'";
$sth_html = $dbh->prepare($query_html);
$rc_html = $sth_html->execute;
while(($Temp) = $sth_html->fetchrow)
{
$html_message = $Temp;
$html_message =~s/\\\'/'/g;
}
$temp_html = $html_message;
$rc_html = $sth_html->finish;

### Get TEXT ###
$text_message ="";
$query_text = "SELECT TEXT_MESSAGE FROM broadcast where EMAIL_ID =
'$fields[9]'";
$sth_text = $dbh->prepare($query_text);
$rc_text = $sth_text->execute;
while(($Temp) = $sth_text->fetchrow)
{
$text_message = $Temp;
$text_message =~s/\\\'/'/g;
}
my $temp_text = $text_message;
my $rc_text = $sth_text->finish;

unless ($pid = fork)
{

### Get Info To Match ###
my $counter = 0;

if($fields[8] ne "T")
{
$temp_text =~s/##NAME##/$fields[3]/g;
$temp_text =~s/##EU##/$fields[6]/g;

do
{
if(eval {($sender)
->Open({smtp => $ServerName,
to => $fields[4],
from=> '[EMAIL PROTECTED]',
fake_from=>$fields[1],
subject => $fields[0]})
->SendLineEnc($temp_text)
->Close
}) { $retry_counter = 4;} # success
else { $retry_counter++;}
} until $retry_counter >= 2;
}
else # mixed html and plain text
{
$temp_html =~s/##NAME##/$fields[3]/g;
$temp_html =~s/##EU##/$fields[6]/g;
$temp_text =~s/##NAME##/$fields[3]/g;
$temp_text =~s/##EU##/$fields[6]/g;

MIXED:
do
{
if(eval {($sender)
->OpenMultipart({smtp=>$ServerName,
to => $fields[4],
from=> '[EMAIL PROTECTED]',
fake_from=>$fields[2] . "<$fields[1]>",
subject => $fields[0],
multipart => 'alternative',
Boundary =>'_MIME-Boundary-1_--'})
->Body({ctype=>'text/plain',msg => $temp_text})
->Body({ctype=>'text/html',msg => $temp_html})
->Close
} > 0) {

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
$year = $year + 1900;
my $finish_date = $year . "-" . $mon . "-" . $mday;

### Insert into Log Table ###
my $querylog = "insert into log
(LOG_ID,EU,EMAIL,DATE_PROCESSED) values(NULL,?, ?, ?)";
my $sthlog = $dbh->prepare($querylog);
my $rclog =
$sthlog->execute($fields[6],$fields[4],$finish_date);

$retry_counter = 4;
$counter++;
} # success
else
{
$retry_counter++;
if ($retry_counter >=2)
{
$counter++;
}
else
{
goto MIXED;
}
}
} until $retry_counter >= 2;
}
### Remove User Info From Database ##
my $query3 = "DELETE FROM maildata WHERE EU = '$fields[6]' and
EMAIL_ID='$fields[9]'";
my $sth3 = $dbh->prepare($query3);
my $rc3 = $sth3->execute();

$retry_counter = 0;
exit 0;
}
waitpid($pid,0);
}



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




Re: chgrp

2002-11-07 Thread John W. Krahn
[ Message rearranged in chronological order ]

[ Signatures and other non relevant stuff removed ]


Nikola Janceski wrote:
> 
> > From: John W. Krahn [mailto:krahnj@;acm.org]
> >
> > Nikola Janceski wrote:
> > >
> > > I know there is a chmod function in Perl, but is there a
> > > chgrp function or module?
> >
> > perldoc -f chown
> 
> Facinating, so is that a no?

No, there is not a specific chgrp function because chown does that.

perldoc -f chown

   chown LIST
   Changes the owner (and group) of a list of files.
   The first two elements of the list must be the
   numeric uid and gid, in that order.  A value of -1
   in either position is interpreted by most systems
   to leave that value unchanged.  Returns the number
   of files successfully changed.


So if you want a chgrp function:

sub chgrp { chown -1, @_ };




John
-- 
use Perl;
program
fulfillment

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




Re: Non valid emails

2002-11-07 Thread Michael Fowler
On Thu, Nov 07, 2002 at 01:26:22PM -, dan wrote:
> Is there some moderator or something of this board that can delete emails
> from the mailing list that haven't been used, or been retrievable, for a
> certain amount of time? I think it gets annoying when you post to the
> newsgroup, and then get a few Mailer Daemon responses saying the message
> couldn't be delivered to X people because of Y reason.

When I start getting consistently bounced emails from a single person I
email [EMAIL PROTECTED] and the owner unsubscribes the email address.

Be careful under what conditions you tell the owner about it; make sure the
email address is consistently bouncing emails.  For example, if the owner is
on vacation and you're receiving vacation messages (I hate that).  I usually
don't notify the owner if a message is bouncing with an error that could be
cleared up, unless it happens for a while.


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

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




Re: Population of variables in hash values...

2002-11-07 Thread Tim Yohn
On Thu, 7 Nov 2002 11:04:26 -0800 
Timothy Johnson <[EMAIL PROTECTED]> wrote:

> 
> It sounds like the eval solution proposed earlier is exactly what
> you're looking for then.  You can just store the string in your hash
> and eval it when you need to print.

Yup!  With a little reworking of how I'm calling everything that worked
like a charm.  Thanks for the help everyone!

Tim.

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




Data extraction from text file (overwhelmed newbie) (1/1)

2002-11-07 Thread Philip Neukom

begin 644 OrderSampleFinished.txt
M*C$)4%=#+U!(5R!#55-43TU%4@DJ,S`W,#D)9&5S8W)I<'1I;VXQ"41E


Data extraction from text file (overwhelmed newbie) (0/1)

2002-11-07 Thread Philip Neukom
Hi!
I have a huge print file in txt format that I would like to extract
data from, export to a new text file and then import into a database.
I am less concerned about efficiency as I am with getting this done
quick and dirty.

I am just starting out and am confused as hell.  As the multitude of
ways to do this run through my head I find I am getting no where.

Would some kind soul help this beginning beginer?

My file is ~350MB. (not attached of course) 
It has the structure as shown in the attachment [OrderSample.txt]. 
I have also attached an example of what the data should look like in
final form [OrderSampleFinished.txt].

Each record spans 3 lines. 

I am using ActivePerl.

#!c:\perl\perl -n

use strict;

while(/^Customer\:[ \t]+([\*\d+)[ \t]+(.+)/){
chomp;
my $customer = substr($_,2);
while(/^([\*\d+|\d+][ \t]+([\d+])[ \t]([\d{2}\/[\d{2}\/[\d{2})
... select to end of third line)
my $order = substr($_,19)
while (<>){
next LINE if ($order(2) eq $order(2));
print "$customer$_" ""$order$_" > newfile.txt;
}
}
}

I'm not sure if while is going to work or if I should try to figure
out how to use foreach?

Any help greatly appreciated.
Philip

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




What driver to use with DBI for access 97

2002-11-07 Thread Chris Benco
Just getting started trying to pull some data from a fairly simple access
97 database.  What driver do I need to use to connect in this string..

my $dbh = DBI->connect('DBI:?:framestats.mdb');

I just need to pull a few bits and pieces of data out of this database for
use in another script.  Nothing overly complicated.

Chris Benco
[EMAIL PROTECTED]




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




Re: chgrp

2002-11-07 Thread Tanton Gibbs
http://search.cpan.org/author/SDAGUE/ppt-0.12/bin/chgrp
- Original Message -
From: "Nikola Janceski" <[EMAIL PROTECTED]>
To: "'John W. Krahn'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, November 07, 2002 2:02 PM
Subject: RE: chgrp


> Facinating, so is that a no?
>
> > -Original Message-
> > From: John W. Krahn [mailto:krahnj@;acm.org]
> > Sent: Thursday, November 07, 2002 1:41 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: chgrp
> >
> >
> > Nikola Janceski wrote:
> > >
> > > I know there is a chmod function in Perl, but is there a
> > chgrp function or
> > > module?
> >
> > perldoc -f chown
> >
> >
> > John
> > --
> > use Perl;
> > program
> > fulfillment
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> --
--
> 
> The views and opinions expressed in this email message are the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
>
>
> --
> 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: Population of variables in hash values...

2002-11-07 Thread Timothy Johnson

It sounds like the eval solution proposed earlier is exactly what you're
looking for then.  You can just store the string in your hash and eval it
when you need to print.

-Original Message-
From: Tim Yohn [mailto:tyohn@;alabanza.com]
Sent: Thursday, November 07, 2002 10:54 AM
To: Timothy Johnson
Cc: [EMAIL PROTECTED]
Subject: Re: Population of variables in hash values...


On Thu, 7 Nov 2002 10:35:22 -0800 
Timothy Johnson <[EMAIL PROTECTED]> wrote:

> 
> Then I guess the real question is why you are declaring two variables
> that you want to be concurrently updated when you can just use one.
> 

Obviously I must not be able to explain what I am trying to
accomplish...  I am trying to update the value of the hash without
having to redefine the hash... the example was just that, a very
simplistic example and had no real purpose for existence other than for
me to not have to explain the full code.   Since my simple example
wasn't complex enough to understand why I would want to do it that way
the full example the hash is actually as follows:

%error = (
1  => "Cert and Key locations must be specified",
2  => "Username must be supplied via the -u command line flag",
3  => "Must specifiy an action to take",
10 => "Internal script error during add, please report",
11 => "Home directory is not a directory or link",
12 => "Verification of certificate failed, please check
certificate for validity",
13 => "Verification of key failed, please check key for
validity",
14 => "Certificate modulus and Key modulus blocks do not match,
please check to make sure the correct certificate and key are being
used",
15 => "Specified cert does not exist: ".$cert,
16 => "Specified key does not exist: ".$key,
17 => "Could not fork ".$certcmd." to validate cert: ".$!,
18 => "Could not fork ".$keycmd." to validate key: ".$!,
19 => "Creation of ".$certpath." failed: ".$!,
20 => "Installation of Certificate as
".$certpath."/".$domain.".crt failed",
21 => "Creation of ".$keypath." failed: ".$!,
22 => "Installation of RSA Private key as
".$keypath."/".$domain.".key failed"
); 

Now this is declared at the beginning of the script and depending on
where it is called the variables that I defined in there may contain
different values from when the hash was defined ... for example $keypath
may be /etc/mail/private or it may be /usr/local/ssl/private... I would
prefer not to have to duplicate tons of error messages just because one
variable has changed (and what happens if later we want to install keys
in /usr/bob/keys/private/blah/blah/blah, another error message would
have to be created).  I'm looking for a way to be able to populate the
variables contained in the hash on the fly instead of when the hash was
defined.

Thanks,
Tim.

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




RE: chgrp

2002-11-07 Thread Nikola Janceski
Facinating, so is that a no?

> -Original Message-
> From: John W. Krahn [mailto:krahnj@;acm.org]
> Sent: Thursday, November 07, 2002 1:41 PM
> To: [EMAIL PROTECTED]
> Subject: Re: chgrp
> 
> 
> Nikola Janceski wrote:
> > 
> > I know there is a chmod function in Perl, but is there a 
> chgrp function or
> > module?
> 
> perldoc -f chown
> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




Re: Securing/Encrypting Source

2002-11-07 Thread Felix Geerinckx
on do, 07 nov 2002 13:04:11 GMT, Dan wrote:

> It's occured to me with my perl program near completion, that the
> person that's "hosting" my program isn't.. let's say.. "trustworthy
> enough" to not steal source. 

[...]

> Any clues as to where I go from here?

Find yourself a trustworthy person to host your program.

-- 
felix

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




Re: Population of variables in hash values...

2002-11-07 Thread John W. Krahn
Tim Yohn wrote:
> 
> Hey All,

Hello,

> Is there an easy way to have variables in the value of a hash that are
> not populated until the value of the hash is used... for example:
> 
> my($domain);
> my(%hash) = (
> 1 => "$domain"
> );
> 
> print_domain("test.com");
> 
> sub print_domain() {
> my($domain) = @_;
> 
> print $hash{'1'};
> }
> 
> What ends up happening is the printing of a null string (I understand
> why since $domain didn't contain a value when the hash was initially
> populated)... however what I would like to have happen is the $domain
> value of the hash be populated when it is called in the sub, thus
> printing "test.com".  I've tried references in the hash (i.e. 1 =>
> "\$domain") however then I just received the SCALAR(memaddr) as output.
> Any suggestions that might help point me in the right direction would be
> greatly appreciated.

Try using a reference to the scalar variable.

my $domain;
my %hash = ( 1 => \$domain );


John
-- 
use Perl;
program
fulfillment

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




Re: Population of variables in hash values...

2002-11-07 Thread Tim Yohn
On Thu, 7 Nov 2002 10:35:22 -0800 
Timothy Johnson <[EMAIL PROTECTED]> wrote:

> 
> Then I guess the real question is why you are declaring two variables
> that you want to be concurrently updated when you can just use one.
> 

Obviously I must not be able to explain what I am trying to
accomplish...  I am trying to update the value of the hash without
having to redefine the hash... the example was just that, a very
simplistic example and had no real purpose for existence other than for
me to not have to explain the full code.   Since my simple example
wasn't complex enough to understand why I would want to do it that way
the full example the hash is actually as follows:

%error = (
1  => "Cert and Key locations must be specified",
2  => "Username must be supplied via the -u command line flag",
3  => "Must specifiy an action to take",
10 => "Internal script error during add, please report",
11 => "Home directory is not a directory or link",
12 => "Verification of certificate failed, please check
certificate for validity",
13 => "Verification of key failed, please check key for
validity",
14 => "Certificate modulus and Key modulus blocks do not match,
please check to make sure the correct certificate and key are being
used",
15 => "Specified cert does not exist: ".$cert,
16 => "Specified key does not exist: ".$key,
17 => "Could not fork ".$certcmd." to validate cert: ".$!,
18 => "Could not fork ".$keycmd." to validate key: ".$!,
19 => "Creation of ".$certpath." failed: ".$!,
20 => "Installation of Certificate as
".$certpath."/".$domain.".crt failed",
21 => "Creation of ".$keypath." failed: ".$!,
22 => "Installation of RSA Private key as
".$keypath."/".$domain.".key failed"
); 

Now this is declared at the beginning of the script and depending on
where it is called the variables that I defined in there may contain
different values from when the hash was defined ... for example $keypath
may be /etc/mail/private or it may be /usr/local/ssl/private... I would
prefer not to have to duplicate tons of error messages just because one
variable has changed (and what happens if later we want to install keys
in /usr/bob/keys/private/blah/blah/blah, another error message would
have to be created).  I'm looking for a way to be able to populate the
variables contained in the hash on the fly instead of when the hash was
defined.

Thanks,
Tim.

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




RE: Environment variables and Win32::ODBC

2002-11-07 Thread Daryl J. Hoyt
I think the line is supposed to be:
use Win32::ODBC;

Thanks,


Daryl J. Hoyt
Software Engineer
Geodesic Systems
< http://www.geodesic.com>
< mailto:djh@;geodesic.com>




-Original Message-
From: Angel Iliev Kafazov [mailto:angel.kafazov@;mail.bg]
Sent: Thursday, November 07, 2002 12:48 PM
To: '[EMAIL PROTECTED]'
Subject: Enviroment variables and Win32::ODBC


Hi,

I am trying to write a scipt which generates a web page based on a 
information is ACCESS database. First, I need another script which hava 
to pass the information (user ID) to the one which will actually display 
the other page. I have to pass the infprmation only by clicking on a 
particular link. The scrpt that generates the web page gives me the 
following error:


syntax error at franowner.pl.txt line 1, near "use Win32:"
Execution of franowner.pl.txt aborted due to compilation errors.


the script is:


use Win32:ODBC;


$ownerid = $ENV{'QUERY_STRING'};
$DSN="db1"
$dbh = new Win32::ODBC($DSN);

$statement = "SELECT Field1, Field2, Field3, 
Field4, Field5, Field6 FROM Owners WHERE ID=17";

if ($dbh->Sql($statement)) {
   print "SQL failed.\n";
   print "Error: " . $db->Error() . "\n";
}


$sth = $dbh->prepare($statement);
$rv = $sth->execute || die "Cannot execute SQL statement:\n$DBI:errstr\n";

($ownerfname,$ownerlname,$owneradd,$ownercity,$ownerst,$ownerzip) = $sth-
>fetchrow_arrayref;





It also gives me SQL error when I try to select from columns which names 
are consisted of more than one word
__
12MB-POP3-WAP-SMS---TOBA-E-mail.bG
--

" Ako uckame u Bue agpec B mail.bg 
ugeme myk: http://www.mail.bg/new/ "

-- 
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: Population of variables in hash values...

2002-11-07 Thread Felix Geerinckx
on do, 07 nov 2002 17:13:22 GMT, Tim Yohn wrote:

> Hey All,
> 
> Is there an easy way to have variables in the value of a hash that are
> not populated until the value of the hash is used... 

my($domain);
my(%hash) = (
1 => '$domain'
);

print_domain("test.com");

sub print_domain() {
my($domain) = @_;

print eval "$hash{'1'}";
}


See
perldoc -f eval


-- 
felix

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




Enviroment variables and Win32::ODBC

2002-11-07 Thread Angel Iliev Kafazov
Hi,

I am trying to write a scipt which generates a web page based on a 
information is ACCESS database. First, I need another script which hava 
to pass the information (user ID) to the one which will actually display 
the other page. I have to pass the infprmation only by clicking on a 
particular link. The scrpt that generates the web page gives me the 
following error:


syntax error at franowner.pl.txt line 1, near "use Win32:"
Execution of franowner.pl.txt aborted due to compilation errors.


the script is:


use Win32:ODBC;


$ownerid = $ENV{'QUERY_STRING'};
$DSN="db1"
$dbh = new Win32::ODBC($DSN);

$statement = "SELECT Field1, Field2, Field3, 
Field4, Field5, Field6 FROM Owners WHERE ID=17";

if ($dbh->Sql($statement)) {
   print "SQL failed.\n";
   print "Error: " . $db->Error() . "\n";
}


$sth = $dbh->prepare($statement);
$rv = $sth->execute || die "Cannot execute SQL statement:\n$DBI:errstr\n";

($ownerfname,$ownerlname,$owneradd,$ownercity,$ownerst,$ownerzip) = $sth-
>fetchrow_arrayref;





It also gives me SQL error when I try to select from columns which names 
are consisted of more than one word
__
12MB-POP3-WAP-SMS---TOBA-E-mail.bG
--

" Ako uckame u Bue agpec B mail.bg 
ugeme myk: http://www.mail.bg/new/ "

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




Re: chgrp

2002-11-07 Thread John W. Krahn
Nikola Janceski wrote:
> 
> I know there is a chmod function in Perl, but is there a chgrp function or
> module?

perldoc -f chown


John
-- 
use Perl;
program
fulfillment

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




RE: Population of variables in hash values...

2002-11-07 Thread Timothy Johnson

Then I guess the real question is why you are declaring two variables that
you want to be concurrently updated when you can just use one.

-Original Message-
From: Tim Yohn [mailto:tyohn@;alabanza.com]
Sent: Thursday, November 07, 2002 10:19 AM
To: Timothy Johnson
Subject: Re: Population of variables in hash values...


Nope,

No typo, this is exactly what I am trying to accomplish... I want the
hash to store the variable (and thus be able to reference that variable
and it's current value later on) and not the value of the variable.  You
are correct in the fact that it does not work that way as I posted it,
that's why I asked how to do it.

Tim.

On Thu, 7 Nov 2002 09:38:48 -0800 
Timothy Johnson <[EMAIL PROTECTED]> wrote:

> 
> I don't see how that could possibly work, since you are declaring the
> value of $hash{1} to be $domain, which has not been initialized.  You
> are declaring $hash{1} to be the VALUE of $domain.  When you change
> $domain later, this won't update your hash retroactively.  Maybe this
> is just a typo in your post?
> 
> -Original Message-
> From: Tim Yohn [mailto:tyohn@;alabanza.com]
> Sent: Thursday, November 07, 2002 9:13 AM
> To: [EMAIL PROTECTED]
> Subject: Population of variables in hash values...
> 
> 
> Hey All,
> 
> Is there an easy way to have variables in the value of a hash that are
> not populated until the value of the hash is used... for example:
> 
> my($domain);
> my(%hash) = (
>   1 => "$domain"
> );
> 
> print_domain("test.com");
> 
> sub print_domain() {
>   my($domain) = @_;
> 
>   print $hash{'1'};
> }
> 
> What ends up happening is the printing of a null string (I understand
> why since $domain didn't contain a value when the hash was initially
> populated)... however what I would like to have happen is the $domain
> value of the hash be populated when it is called in the sub, thus
> printing "test.com".  I've tried references in the hash (i.e. 1 =>
> "\$domain") however then I just received the SCALAR(memaddr) as
> output. Any suggestions that might help point me in the right
> direction would be greatly appreciated.
> 
> Thanks,
> Tim.
> 
> -- 
> 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: Population of variables in hash values...

2002-11-07 Thread Timothy Johnson

I don't see how that could possibly work, since you are declaring the value
of $hash{1} to be $domain, which has not been initialized.  You are
declaring $hash{1} to be the VALUE of $domain.  When you change $domain
later, this won't update your hash retroactively.  Maybe this is just a typo
in your post?

-Original Message-
From: Tim Yohn [mailto:tyohn@;alabanza.com]
Sent: Thursday, November 07, 2002 9:13 AM
To: [EMAIL PROTECTED]
Subject: Population of variables in hash values...


Hey All,

Is there an easy way to have variables in the value of a hash that are
not populated until the value of the hash is used... for example:

my($domain);
my(%hash) = (
1 => "$domain"
);

print_domain("test.com");

sub print_domain() {
my($domain) = @_;

print $hash{'1'};
}

What ends up happening is the printing of a null string (I understand
why since $domain didn't contain a value when the hash was initially
populated)... however what I would like to have happen is the $domain
value of the hash be populated when it is called in the sub, thus
printing "test.com".  I've tried references in the hash (i.e. 1 =>
"\$domain") however then I just received the SCALAR(memaddr) as output. 
Any suggestions that might help point me in the right direction would be
greatly appreciated.

Thanks,
Tim.

-- 
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]




Population of variables in hash values...

2002-11-07 Thread Tim Yohn
Hey All,

Is there an easy way to have variables in the value of a hash that are
not populated until the value of the hash is used... for example:

my($domain);
my(%hash) = (
1 => "$domain"
);

print_domain("test.com");

sub print_domain() {
my($domain) = @_;

print $hash{'1'};
}

What ends up happening is the printing of a null string (I understand
why since $domain didn't contain a value when the hash was initially
populated)... however what I would like to have happen is the $domain
value of the hash be populated when it is called in the sub, thus
printing "test.com".  I've tried references in the hash (i.e. 1 =>
"\$domain") however then I just received the SCALAR(memaddr) as output. 
Any suggestions that might help point me in the right direction would be
greatly appreciated.

Thanks,
Tim.

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




RE: command help using open/backticks

2002-11-07 Thread Nikola Janceski
I have found one work around, but I was hoping there would be some other
way..

perhaps this suggestion can make it into Perl 6?

current work around:
perldoc perlipc
search for "execute something without the shell's interference"

> -Original Message-
> From: Nikola Janceski [mailto:nikola_janceski@;summithq.com]
> Sent: Thursday, November 07, 2002 11:21 AM
> To: Beginners (E-mail)
> Subject: command help using open/backticks
> 
> 
> Here's my situation...
> 
> I have a command I need to run and parse the output of, BUT 
> the command is
> longer than 255 characters.
> is there a way to use the PROGRAM LIST format for backticks 
> or open the same
> way you can for exec and system?
> 
> Nikola Janceski
> 
> There is no great concurrence between learning and wisdom.
> -- Francis Bacon
> 
> 
> --
> --
> 
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




command help using open/backticks

2002-11-07 Thread Nikola Janceski
Here's my situation...

I have a command I need to run and parse the output of, BUT the command is
longer than 255 characters.
is there a way to use the PROGRAM LIST format for backticks or open the same
way you can for exec and system?

Nikola Janceski

There is no great concurrence between learning and wisdom.
-- Francis Bacon




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




RE: Securing/Encrypting Source

2002-11-07 Thread Clay-1, Matthew

Take a look at shroud 

http://cpan.org/scripts/UNIX/System_administration/index.html

 -Original Message-
From:   dan [mailto:dan@;abovenet.org] 
Sent:   Thursday, November 07, 2002 8:04 AM
To: [EMAIL PROTECTED]
Subject:Securing/Encrypting Source

Hi again!

It's occured to me with my perl program near completion, that the person
that's "hosting" my program isn't.. let's say.. "trustworthy enough" to not
steal source. So i'm looking for way(s) to secure/encrypt/compile my source
so it can't be stolen. It's running on a Linux system, with perl 5.8.0
installed. Any clues as to where I go from here?

dan



-- 
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: Non valid emails

2002-11-07 Thread Timothy Johnson
 
I'd second that motion.  There are a few addresses that I would have
submitted in the past if I had known where to send them...

-Original Message-
From: dan
To: [EMAIL PROTECTED]
Sent: 11/7/02 5:26 AM
Subject: Non valid emails

And another thing...

Is there some moderator or something of this board that can delete
emails
from the mailing list that haven't been used, or been retrievable, for a
certain amount of time? I think it gets annoying when you post to the
newsgroup, and then get a few Mailer Daemon responses saying the message
couldn't be delivered to X people because of Y reason.

dan



-- 
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: Securing/Encrypting Source

2002-11-07 Thread dan
answering my own question, i read back the newsgroup a little, and came
across an article about perlcc. i tried this..
perlcc -o output input.pl
however, since my program uses DBI, the end compiled program reads:

Connecting to SQL...
Undefined subroutine &DBI::dr::connect called at
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 503.
Undefined subroutine &DBI::dr::disconnect_all called at
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/DBI.pm line 565.
END failed--call queue aborted.

any ideas how i may be able to come over this?

dan

"Paul Johnson" <[EMAIL PROTECTED]> wrote in message
news:50164.193.134.254.145.1036676071.squirrel@;wesley.pjcj.net...
>
> dan said:
> > Hi again!
> >
> > It's occured to me with my perl program near completion, that the person
> > that's "hosting" my program isn't.. let's say.. "trustworthy enough" to
> > not steal source. So i'm looking for way(s) to secure/encrypt/compile my
> > source so it can't be stolen. It's running on a Linux system, with perl
> > 5.8.0 installed. Any clues as to where I go from here?
>
> The best way is to place a copyright message in the program, and maybe to
> add a note saying that the code belongs to you and may not be used without
> your permission.
>
> Technical solutions don't work.  How much do big companies invest in
> technical solutions?  How well do they work?
>
> Having said that, you'll no doubt get a number of suggestions that might
> make it harder to see the source.  Maybe that is sufficient for you.
>
> --
> Paul Johnson - [EMAIL PROTECTED]
> http://www.pjcj.net
>
>
>



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




RE: Securing/Encrypting Source

2002-11-07 Thread Clay-1, Matthew
Take a look at shroud 

http://cpan.org/scripts/UNIX/System_administration/index.html

 -Original Message-
From:   dan [mailto:dan@;abovenet.org] 
Sent:   Thursday, November 07, 2002 8:04 AM
To: [EMAIL PROTECTED]
Subject:Securing/Encrypting Source

Hi again!

It's occured to me with my perl program near completion, that the person
that's "hosting" my program isn't.. let's say.. "trustworthy enough" to not
steal source. So i'm looking for way(s) to secure/encrypt/compile my source
so it can't be stolen. It's running on a Linux system, with perl 5.8.0
installed. Any clues as to where I go from here?

dan



-- 
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]




chgrp

2002-11-07 Thread Nikola Janceski
I know there is a chmod function in Perl, but is there a chgrp function or
module?
I am using 5.6.1

Nikola Janceski

When choosing between two evils, I always like to try the one I've never
tried before.
-- Mae West (1892-1980) 




The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




RE: linux pearl??

2002-11-07 Thread WALTER HUNNEL
I did a fresh instal of RedHat8.0, and a WHICH PERL returns /USR/BIN/PERL so I think 
it is installed by default - you might look for it even if you did not specifically 
request it be installed. 

I could be totally out in left field, too.

Walt

>>> Charlotte Oliver <[EMAIL PROTECTED]> 11/06/02 12:43PM >>>
> If you purchased RH8.0, then your best resource is to call 
> Red Hat.  They have very good technical support and will 
> guide you.  Their manuals are also very good.  If you got the 
> CD's from your local Linux Users Group, then they would be 
> the best people to ask.  If you downloaded the CDs form the 
> 'Net, then mount the ISO via the loopback device or insert 
> the CD that you burned and type:
>   find /mnt/cdrom/ -type f -name 'perl*.rpm'


You could also try "locate perl" or "whereis perl" on the command line.
Usually it's someplace like \usr\bin\perl, though.

I don't run Redhat though, so your mileage may vary.

Cheers,
Charlotte

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



Re: sending EOF

2002-11-07 Thread Jenda Krynicky
From: Mark Goland <[EMAIL PROTECTED]>
> In my script I am need to send an explicit EOF to another program, I
> open inside my script. Something like this...
> 
> open FH,"| prog that runs";
> 
> print FH "blah blah";
> 
> print FH "EOF" # send program EOF.
> 
> I tryd closing the handle , but that didnt work. Any Idea's ??

Try

print FH "\n\cZ";
close FH;
# under DOS/Win

or

print FH "\n\cD";
close FH;
# undef Unix

Whether the program will take that as an EOF I can't tell though.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


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




Re: Securing/Encrypting Source

2002-11-07 Thread Paul Johnson

dan said:
> Hi again!
>
> It's occured to me with my perl program near completion, that the person
> that's "hosting" my program isn't.. let's say.. "trustworthy enough" to
> not steal source. So i'm looking for way(s) to secure/encrypt/compile my
> source so it can't be stolen. It's running on a Linux system, with perl
> 5.8.0 installed. Any clues as to where I go from here?

The best way is to place a copyright message in the program, and maybe to
add a note saying that the code belongs to you and may not be used without
your permission.

Technical solutions don't work.  How much do big companies invest in
technical solutions?  How well do they work?

Having said that, you'll no doubt get a number of suggestions that might
make it harder to see the source.  Maybe that is sufficient for you.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net




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




Re: Split a file

2002-11-07 Thread zentara
On Wed, 06 Nov 2002 10:17:00 -0600, [EMAIL PROTECTED] (Robert
Citek) wrote:

>>I am trying to take a file of variable length on a daily basis and
>>divide it up into 4 equal parts for processing on each file.  Does
>>someone have an easy way to do this?  

>Below is a sample script which may lead you in the right direction.  If you
>call it foo.pl, you can use it like so:
>  # seq 1 100 | foo.pl
>or like so:
>  # foo.pl some.file.txt

There is also cut-file.pl which you might want to look at.
It handles binaries well. It's on cpan.
http://cpan.org/scripts/index.html



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




Non valid emails

2002-11-07 Thread dan
And another thing...

Is there some moderator or something of this board that can delete emails
from the mailing list that haven't been used, or been retrievable, for a
certain amount of time? I think it gets annoying when you post to the
newsgroup, and then get a few Mailer Daemon responses saying the message
couldn't be delivered to X people because of Y reason.

dan



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




Securing/Encrypting Source

2002-11-07 Thread dan
Hi again!

It's occured to me with my perl program near completion, that the person
that's "hosting" my program isn't.. let's say.. "trustworthy enough" to not
steal source. So i'm looking for way(s) to secure/encrypt/compile my source
so it can't be stolen. It's running on a Linux system, with perl 5.8.0
installed. Any clues as to where I go from here?

dan



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




Weekly list FAQ posting

2002-11-07 Thread casey
NAME
beginners-faq - FAQ for the beginners mailing list

1 -  Administriva
  1.1 - I'm not subscribed - how do I subscribe?

Send mail to <[EMAIL PROTECTED]>

You can also specify your subscription email address by sending email to
(assuming [EMAIL PROTECTED] is your email address):

<[EMAIL PROTECTED]>.

  1.2 -  How do I unsubscribe?

Now, why would you want to do that? Send mail to
<[EMAIL PROTECTED]>, and wait for a response. Once you
reply to the response, you'll be unsubscribed. If that doesn't work,
find the email address which you are subscribed from and send an email
like the following (let's assume your email is [EMAIL PROTECTED]):

<[EMAIL PROTECTED]>

  1.3 - There is too much traffic on this list. Is there a digest?

Yes. To subscribe to the digest version of this list send an email to:

<[EMAIL PROTECTED]>

To unsubscribe from the digest, send an email to:

<[EMAIL PROTECTED]>

This is a high traffic list (100+ messages per day), so please subscribe
in the way which is best for you.

  1.4 - Is there an archive on the web?

Yes, there is. It is located at:

http://archive.develooper.com/beginners%40perl.org/

  1.5 - How can I get this FAQ?

This document will be emailed to the list once a week, and will be
available online in the archives, and at http://learn.perl.org/

  1.6 - I don't see something in the FAQ, how can I make a suggestion?

Send an email to <[EMAIL PROTECTED]> with your suggestion.

  1.7 - Is there a supporting website for this list?

Yes, there is. It is located at:

http://beginners.perl.org/

  1.8 - Who owns this list?  Who do I complain to?

Casey West owns the beginners list. You can contact him at
[EMAIL PROTECTED]

  1.9 - Who currently maintains the FAQ?

Kevin Meltzer, who can be reached at the email address (for FAQ
suggestions only) in question 1.6

  1.10 - Who will maintain peace and flow on the list?

Casey West, Kevin Meltzer and Ask Bjoern Hansen currently carry large,
yet padded, clue-sticks to maintain peace and order on the list. If you
are privately emailed by one of these folks for flaming, being
off-topic, etc... please listen to what they say. If you see a message
sent to the list by one of these people saying that a thread is closed,
do not continue to post to the list on that thread! If you do, you will
not only meet face to face with a XQJ-37 nuclear powered pansexual
roto-plooker, but you may also be taken off of the list. These people
simply want to make sure the list stays topical, and above-all, useful
to Perl beginners.

  1.11 - When was this FAQ last updated?

Sept 07, 2001

2 -  Questions about the 'beginners' list.
  2.1 - What is the list for?

A list for beginning Perl programmers to ask questions in a friendly
atmosphere.

  2.2 - What is this list _not_ for?

* SPAM
* Homework
* Solicitation
* Things that aren't Perl related
* Monkeys
* Monkeys solicitating homework on non-Perl related SPAM.
  2.3 - Are there any rules?

Yes. As with most communities, there are rules. Not many, and ones that
shouldn't need to be mentioned, but they are.

* Be nice
* No flaming
* Have fun
  2.4 - What topics are allowed on this list?

Basically, if it has to do with Perl, then it is allowed. You can ask
CGI, networking, syntax, style, etc... types of questions. If your
question has nothing at all to do with Perl, it will likely be ignored.
If it has anything to do with Perl, it will likely be answered.

  2.5 - I want to help, what should I do?

Subscribe to the list! If you see a question which you can give an
idiomatic and Good answer to, answer away! If you do not know the
answer, wait for someone to answer, and learn a little.

  2.6 - Is there anything I should keep in mind while answering?

We don't want to see 'RTFM'. That isn't very helpful. Instead, guide the
beginner to the place in the FM they should R :)

Please do not quote the documentation unless you have something to add
to it. It is better to direct someone to the documentation so they
hopefully will read documentation above and beyond that which answers
their question. It also helps teach them how to use the documentation.

  2.7 - I don't want to post a question if it is in an FAQ. Where should I
look first?

Look in the FAQ! Get acquainted with the 'perldoc' utility, and use it.
It can save everyone time if you look in the Perl FAQs first, instead of
having a list of people refer you to the Perl FAQs :) You can learn
about 'perldoc' by typing:

"perldoc perldoc"

At your command prompt. You can also view documentation online at:

http://www.perldoc.com and http://www.perl.com

  2.8 Is this a high traffic list?

YES! You have been warned! If you don't want to get ~100 emails per day
from this

Re: Of LIB=, Makemaker, and alternate locations for libraries of perl extensions and apps

2002-11-07 Thread Michael G Schwern
On Fri, Nov 01, 2002 at 11:15:15AM -0800, George Szynal wrote:
> For those who want/need to install a Perl app or extension without perturbing the 
>default perl library tree.
> Possible reasons:
>1. Disambiguating the existing libs from your libs (for testing perhaps)
>2. Not wanting to or not having rights to login as a supervisor (or as a user 
>with admin rights)
>3. Prefer to encapsulate resources in a local tree (easy to move / remove, or 
>whatever reason)
>4. Yet another reason I may have overlooked
> 
> lessons learned are:
>   a.  utilize the 'LIB= argument when creating your makefile
>   example:  perl  Makefile.PL  LIB=/users/george/myperlprogram/lib/

This is due to bugs in MakeMaker prior to 6.XX (ie. what comes with perl
prior to 5.8.0).  The proper thing to use is PREFIX, not LIB.  PREFIX
covers *all* files installed by MakeMaker: libraries, programs,
documentation, etc...  LIB only effects where libraries go.  Bugs in old
versions of MakeMaker meant PREFIX was often ignored, these have been fixed
and new versions of MakeMaker are available as stand-alone modules (ie. you
don't have to upgrade perl) from CPAN.

Since many people still use the old MakeMaker, you can cover your bases by
specifying both PREFIX and LIB

perl Makefile.PL PREFIX=foo/bar/ LIB=foo/bar/lib/

You might also have to specify the INSTALLMAN3DIR, INSTALLMAN1DIR,
INSTALLBIN and INSTALLSCRIPT to cover man pages and programs installed.
There's a lot of voodoo involved as to when the bug manifests itself.

Sorry for the inconvenience.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance  <[EMAIL PROTECTED]> Kwalitee Is Job One
It's Ecstacy time!

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




RE: pattern

2002-11-07 Thread Aman Thind
Hi Javed 

Try the following regex :

@testList =
("SDK_0.9.4.5_20020711_IR_DEV","SDK_0.9.4.5_20020711_IR","SDK0.9.4.5_2002071
1_IR_DEV") ;

foreach $testName(@testList)
{
if($testName =~ /^SDK[_0-9.]*_IR(_DEV){0,1}$/)
 {
  print "match successful for $testName ! :)\n";
 } 
else
 {
  print "match failed for $testName ! :(\n";
 }  
}

It's much more elegant and flexible :") and i've tried to catch all the
exceptions that may occur in the matching.

Any suggestions \ queries...please let me know. 

-aman.



-Original Message-
From: Javeed SAR [mailto:SAR.Javeed@;sisl.co.in]
Sent: Thursday, November 07, 2002 12:20 PM
To: [EMAIL PROTECTED]
Subject: pattern



Hi all,
I want to input a string which is used to create file name, and I
want to 
allow input string to consist of letters(SDK) at the start and only
IR and DEV inbetween, and numbers(0-9) and 
underscore( _ ) within file name. 
Is the pattern right. 
m/^SDK[0-9]|^SDK_[0-9]|^SDK_[0-9]_IR|^SDK_[0-9]_IR_DEV$/ 


if ($input =~ /what pattern /){ 
create file 
} else { 
exit 0; } 

Regards 




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