Re: move data into separate directory

2003-02-06 Thread Rob Dixon
Jose Malacara wrote:
>> opendir(DIR, 'data') ...
>
> This allows me to grab the correct file names from within the 'data'
> directory, but I guess that my problem happens when the script
> actually goes to parse those files that it only looks for the
> filenames locally, rather than in the actual 'data' directory.
>
>> while ()...
>
> This give me the correct file called 'logfile1', but I need my INFILE
> to actually be pointing to 'data/logfile1'

Joseph's right. Without specifying a path you're opening ./logfile1 on
handle INFILE. You have two choices: specify a path in your open:

open INFILE, 'data/'.$input;

or move your current working directory to 'data', which is your best
bet if /all/ of your data files (both input and output) are there.
'chdir' will do this for you:

> #!/usr/bin/perl -w
> use strict;
> use Text::CSV;
>
> my $ip=$ARGV[0];
> my $csv=Text::CSV->new();

chdir 'data';

> opendir(DIR, "data");   #<=== 'data' directory contains several log

opendir DIR, '.' or die $!;

> files to be parsed.
> my @files = readdir(DIR);

closedir DIR;

> foreach my $file (@files) {
>my $input="$file";

No need to copy $file, you can use it directly.

> open(INFILE,"$input") || die "Can't open file $input";   #<=== is

open INFILE, $file or die $!;

> opening correct file name, but not 'data/logfile1.
>
>
> while () {
> chomp;
>  if($csv->parse($_)) {
> if (m|$ip|) {
> my @fields=$csv->fields;
> print "$fields[0],$fields[4],$fields[5],$fields[6]\n";
> }
> }
> }
> }
>
> closedir(DIR);

Do this after you've finished reading it.

> close INFILE;


This should work roughly as intended. If you need to know what
your current working directory is,

use Cwd;

which imports subroutine 'cwd', amongst other things, and lets you
do this sort of thing:

my $fullpath = cwd.$basename;

Also you might consider using 'glob' as follows:

my @files = glob 'data/*';
or
chdir 'data';
my @files = glob '*';

You can even miss out all the intermediate 'opendir' call
and temporary variables with this:

chdir 'data';
foreach my $file ( glob '*' ) {
:
}

HTH,

Rob




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




Re: Modifying the string entered

2003-02-06 Thread Rob Dixon
R. Joseph Newton wrote:
> Rob Dixon wrote:
>
>>
>> my ( $path, $file ) = ( $fullpath =~ /(.*)\/(.*)/ );
>>
>
> Ah, but that would be cracking the egg at the small end, which only a
> barbarian would do  )( ;o })

No, not a barbarian, just a rebel. I slice my hot-dog buns on the flat
as well :)

(What's that thing on your head Joseph? Do you wear a bow?)

/R







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




Re: a though question of using variable in pattern

2003-02-06 Thread Rob Dixon
Kasi ramanathen wrote:
> by using this code i get the right answer, but i want to store the
> pattern in the variable and use it, for pattern, it fails. what is
> the problem. is it related to priority of operator.
>
> open(IH, " @a=();
> $v=join(' ',@a);

same as
$v = "@a";

> while($v=~m/href=\"(.*?)\">/gi)
> {
> print "\n$1";
> print 1;
> }
>
> ***
>
> i want to change line number 4
>
> while($v=~m/href=\"(.*?)\">/gi)
> with,
>
> $t="href=\"(.*?)\">";
>
> with
>
> while($v=~m/$t/gi)

Hi again Kasi. Still not using /x ?  ;-)

Look:

print my $t="href=\"(.*?)\">";
outputs
href="(.*?)">

Not the same, is it? You should be able to see why. Since we're
trying hard to help you you should take notice of the advice
we give:

- use strict
- use warnings
- use /x to lay out complex regexes
- use qr/../ to define regex constants

If you're still stuck after you've tried these ideas then come back
to us and we'll sort things out.

Good luck!

Rob




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




Re: move data into separate directory

2003-02-06 Thread Rob Dixon
Rob Dixon made a couple of mistakes in writing:
>>
>> closedir(DIR);
>
> Do this after you've finished reading it.

(meaning 'directly after you've finished reading the directory' :)

> This should work roughly as intended. If you need to know what
> your current working directory is,
>
> use Cwd;
>
> which imports subroutine 'cwd', amongst other things, and lets you
> do this sort of thing:
>
> my $fullpath = cwd.$basename;

more precisely

my $fullpath = cwd.'/'.$basename;

> Also you might consider using 'glob' as follows:

Cheers,

Rob




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




Re: Modifying the string entered

2003-02-06 Thread wiggins


On Thu, 6 Feb 2003 12:24:51 -, "Rob Dixon" <[EMAIL PROTECTED]> wrote:

> R. Joseph Newton wrote:
> > Rob Dixon wrote:
> >
> >>
> >> my ( $path, $file ) = ( $fullpath =~ /(.*)\/(.*)/ );
> >>
> >
> > Ah, but that would be cracking the egg at the small end, which only a
> > barbarian would do  )( ;o })
> 
> No, not a barbarian, just a rebel. I slice my hot-dog buns on the flat
> as well :)
> 
> (What's that thing on your head Joseph? Do you wear a bow?)
> 


You brits, can't you get your hot dog buns pre-sliced over there? ;-)


http://danconia.org

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




Re: Modifying the string entered

2003-02-06 Thread Rob Dixon
[EMAIL PROTECTED] wrote:
> 
> 
> You brits, can't you get your hot dog buns pre-sliced over there? ;-)
> 

Not arrogant, just qq[having "self-power" awareness] :)

Believe it or not, our 'Sainbury's' supermarket started pre-slicing
their hot-dog buns a couple or three years ago, but for several
months they were sliced flat, like a burger bun, until enough
people complained! That's TMTOWTDI retailing for you!

/R




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




Premature end of script headers

2003-02-06 Thread zegdatwel
hi,

"Premature end of script headers"

what can this mean...it's in the error log. When does this happen? I got error 500 
when executing script.

Martin


Weekly list FAQ posting

2003-02-06 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

help please!

2003-02-06 Thread Benjamin Jeeves
Hi All

I have a require statement that is run by my main program but I get a error 
"did not return a true value at ./connecttime.pl line 26,  line 
11811302." connecttime.pl is the main program and the script it is executing 
this to do pattern matching on the file that is passed to connecttime.pl can 
oneone tell me were I have gone wrong please
-- 
Thank You



Benjamin Jeeves

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




Re: help please!

2003-02-06 Thread Rob Dixon
Benjamin Jeeves wrote:
> Hi All
>
> I have a require statement that is run by my main program but I get a
> error "did not return a true value at ./connecttime.pl line 26,
>  line 11811302." connecttime.pl is the main program and the
> script it is executing this to do pattern matching on the file that
> is passed to connecttime.pl can oneone tell me were I have gone wrong
> please

'require' needs the value returned from the inlcuded to be true. Any
defined non-zero value will do but traditionally Perl modules have

1;

as their last line.

HTH,

Rob




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




Re: Premature end of script headers

2003-02-06 Thread Rob Dixon
Zegdatwel wrote:
> hi,
>
> "Premature end of script headers"
>
> what can this mean...it's in the error log. When does this happen? I
> got error 500 when executing script.

Check the permission settings on your script. try chmod 755.

HTH,

Rob




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




RE: How to send an e-mail from perl script on windows using SMTP?

2003-02-06 Thread Madhu Reddy
Hi,
 I did telnet ..i got following error

-
C: telnet ivhpxc0003.ap.bdi.gte.com 25
Connecting To ivhpxc0003.ap.bdi.gte.com...Could not
open a connection to host on port 25 : Connect failed

C:telnet ivhpxc0003.ap.bdi.gte.com
Connecting To ivhpxc0003.ap.bdi.gte.com...Could not
open a connection to host: Connect failed

-

what couldbe the error ?

Thanx
-Madhu




--- Timothy Johnson <[EMAIL PROTECTED]> wrote:
> 
> Assuming that ivhpxc0003.ap.bdi.gte.com is your
> email server, I would first
> try to do a "telnet ivhpxc0003.ap.bdi.gte.com 25" at
> the command prompt.  If
> you get a connection refused or denied message, then
> you will not be able to
> send the email from your script.
> 
> -Original Message-
> From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 05, 2003 6:11 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: How to send an e-mail from perl script
> on windows using
> SMTP?
> 
> 
> I changed to Net::SMTP
> still i am getting following error
> 
> Couldnt make Connection: Unknown error
> 
> 
> 
> --- david <[EMAIL PROTECTED]> wrote:
> > Madhu Reddy wrote:
> > 
> > > use NET::SMTP ;
> > 
> > should probably be:
> > 
> > use Net::SMTP;
> > 
> > unless NET::SMTP is a new module.
> > 
> > david
> > 
> > -- 
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.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]
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: Net::FTP troubles

2003-02-06 Thread Rob Das
Sean:

I had all sorts of problems with this on NT. Works great on Unix. To FTP to
NT:
Needs Microsoft IIS (Option Pack?) installed.
Once this is set up, the following changes need to be made:
q Start up the Microsoft Management Console - Start, Programs, Windows NT
4.0 Option Pack, Microsoft Internet Information Server, Internet Service
Manager.
q Right click on Default FTP Site and select Properties
q Click on the Home Directory tab
q Make sure "Write" is checked. 
q Change the Local Path to whatever directory is needed.
q Click on Apply, and exit.

The local path specified above is accessed as "\". 

Rob Das

-Original Message-
From: R. Joseph Newton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 11:42 PM
To: Caenepeel, Sean [R&D/0111]
Cc: [EMAIL PROTECTED]
Subject: Re: Net::FTP troubles


"Caenepeel, Sean [R&D/0111]" wrote:

> Hello,
>
> I am having some difficulty downloadinging a file with the Net::FTP
module.
> ...

> $ftp->cwd($path) ||
> die "Could not cd to $path.";
> $ftp->get($filename) ||
> die "Could not get file.";

HI Sean,

I haven't worked with this module, but from my experiences using the FTP
protocol, I am wondering whether this is transmitting in text mode or
binary.  You might want to check the documentation for a mode parameter to
the get command, or mode attribute for the Net::FTP object.

Joseph



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




text manipulation scenario...

2003-02-06 Thread Gorden-Ozgul, Patricia E
I need to construct a working printf statement where each field in a given
record
would print at a specified position.

Each record may or may not contain any particular field but will always
begin with .VENDOR.LIBRARY. and end with .VENDOR.XINFO.END.

Hope springs eternal for this novice perl scripter.  If you can't help me,
but can refer me to another list which might - I'd appreciate that.

Pat Gorden-Ozgul
[EMAIL PROTECTED] / [EMAIL PROTECTED]


A sample from the datafile: 

.VENDOR_LIBRARY. BNL-MAIN
.VENDOR_ID. 070001
.VENDOR_NAME. Research Books, Inc. / scholium
.VENDOR_GROUP2. DOMESTIC
.VENDOR_ADDR1_BEGIN.
.PHONE. 800 445 7359   203 245 3279
.FAX. 203 245 1830
.LINE. 38 Academy Street
.CITY. Madison
.STATE. Ct
.ZIP. 06443
.VENDOR_ADDR1_END.
.VENDOR_ADDR2_BEGIN.
.LINE. 38 Academy Street
.CITY. Madison
.STATE. Ct
.ZIP. 06443
.VENDOR_ADDR2_END.
.VENDOR_XINFO_BEGIN.
.PAYTO. Research Books, Inc. / scholium
.VENDOR_XINFO_END.

.VENDOR_LIBRARY. BNL-MAIN
.VENDOR_ID. 070097
.VENDOR_NAME. Aspen Publishers Inc.
.VENDOR_GROUP2. DOMESTIC
.VENDOR_ADDR1_BEGIN.
.PHONE. (800)234-1660
.LINE. 7201 McKinney Circle
.CITY. Frederick
.STATE. MD
.ZIP. 21704
.VENDOR_ADDR1_END.
.VENDOR_ADDR2_BEGIN.
.ATTN. Accounts Receivable
.LINE. P.O. Box 64054
.CITY. Baltimore
.STATE. MD
.ZIP. 21264-4054
.VENDOR_ADDR2_END.
.VENDOR_XINFO_BEGIN.
.PAYTO. Aspen Publishers Inc.
.VENDOR_XINFO_END.

.VENDOR_LIBRARY. BNL-MAIN
.VENDOR_ID. 070014
.VENDOR_NAME. John Wiley and Sons, Inc.
.VENDOR_GROUP2. DOMESTIC
.VENDOR_ADDR1_BEGIN.
.ATTN. Order Department
.LINE. Eastern Distribution Center
.LINE2. One Wiley Drive
.CITY. Somerset
.STATE. NJ
.ZIP. 08875
.COUNTRY. USA
.PHONE. (800) 225-5945
.VENDOR_ADDR1_END.
.VENDOR_ADDR2_BEGIN.
.ATTN. John Wiley & Sons, Inc.
.LINE. P.O. Box 18684
.CITY. Newark
.STATE. NJ
.ZIP. 07191-8684
.COUNTRY. USA
.PHONE. (908) 469-4400
.VENDOR_ADDR2_END.
.VENDOR_XINFO_BEGIN.
.PAYTO. John Wiley & Sons, Inc.
.VENDOR_XINFO_END.

.VENDOR_LIBRARY. BNL-MAIN
.VENDOR_ID. 070001
.VENDOR_NAME. Research Books, Inc. / scholium
.VENDOR_GROUP2. DOMESTIC
.VENDOR_ADDR1_BEGIN.
.PHONE. 800 445 7359   203 245 3279
.FAX. 203 245 1830
.LINE. 38 Academy Street
.CITY. Madison
.STATE. Ct
.ZIP. 06443
.VENDOR_ADDR1_END.
.VENDOR_ADDR2_BEGIN.
.LINE. 38 Academy Street
.CITY. Madison
.STATE. Ct
.ZIP. 06443
.VENDOR_ADDR2_END.
.VENDOR_XINFO_BEGIN.
.PAYTO. Research Books, Inc. / scholium
.VENDOR_XINFO_END.

.VENDOR_LIBRARY. BNL-MAIN
.VENDOR_ID. 070001
.VENDOR_NAME. Research Books, Inc. / scholium
.VENDOR_GROUP2. DOMESTIC
.VENDOR_ADDR1_BEGIN.
.PHONE. 800 445 7359   203 245 3279
.FAX. 203 245 1830
.LINE. 38 Academy Street
.CITY. Madison
.STATE. Ct
.ZIP. 06443
.VENDOR_ADDR1_END.
.VENDOR_ADDR2_BEGIN.
.LINE. 38 Academy Street
.CITY. Madison
.STATE. Ct
.ZIP. 06443
.VENDOR_ADDR2_END.
.VENDOR_XINFO_BEGIN.
.PAYTO. Research Books, Inc. / scholium
.VENDOR_XINFO_END.


The code:


# script:  peoplesoft_vendors.pl
# author:  PGO
# description:  Generate PeopleSoft 'VN'vendor batch file
#   from API output
# date:  01/31/03


my $file_in = 'vendshrt';

my $library = ".VENDOR_LIBRARY. ";
my $library_out = " ";
my $id = ".VENDOR.ID. ";
my $id_out = " ";
my $name = ".VENDOR_NAME. ";
my $name_out = " ";
my $payto = ".PAYTO. ";
my $payto_out = " ";
my $group2 = ".VENDOR_GROUP2. ";
my $group2_out = " ";
my $phone1 = ".PHONE. " ;
my $phone1_out = " ";
my $fax = ".FAX. ";
my $fax_out = " ";
my $addr1_line = ".LINE. ";
my $addr1_line_out = " ";

my $blank8 = "";

open(DATA, "$file_in") || die ;

  while ()
  {
 chomp ($line);
# debug
# print "this line is: $_"; 

 if ($line =~ /$library/)
 { 
$line =~ s/$library//g;
print $line;
$library_out = $line;
# debug 
print "library = $library_out";
 }
 if ($line =~ /$payto/)
 {
$line =~ s/$payto//g;
$payto_out = $line;
 }
 if ($line =~ /$id/)
 {
$line =~ s/$id//g;
$id_out = $line;
 }
 if ($line =~ /$name/)
 {
$line =~ s/$name//g;
$name_out = $line;
 }
 if ($line =~ /$group2/)
 {
$line =~ s/$group2//g;
$group2_out = $line;
 }
 if ($payto_out = " ")
 {
$payto_out = substr($name_out,0,39);
# debug
print  "Payto = $payto_out";

 }
 if ($line =~ /$phone1/)
 {
$phone1_out = $line;
 }
 if ($line =~ /$fax/)
 {
$fax_out = $line;
 }
 if ($line =~ /$addr1_line/)
 {
$addr1_line_out = $line;
# debug
print "addr1_line_out = $addr1_line_out";

 }
#  printf "%8s %-40s %-26s \n", $blank8, $payto_out, $addr1_line_out;

  my $library = ".VENDOR_LIBRARY. ";
  my $library_out = " ";
  my $id = ".VENDOR.ID. ";
  my $id_out = " ";
  my $name = ".VENDOR_NAME. ";
  my $name_out = " ";
  my $payto = ".PAYTO. ";
  my $payto_out = " ";
  my $group2 = ".VENDOR_GROUP2. ";
  my $group2_out = " ";
  my $phone1 = ".PHONE. " ;
  

sasdata set

2003-02-06 Thread Benjamin Jurado
can anyone point in the direction of converting sasdata sets into text
files? 
thanks


-- 
Benjamin F. Jurado
IT&E 
GMU


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




RE: text manipulation scenario...

2003-02-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Gorden-Ozgul, Patricia E wrote:
> I need to construct a working printf statement where each field in a
> given record
> would print at a specified position.
> 
> Each record may or may not contain any particular field but will
> always begin with .VENDOR.LIBRARY. and end with .VENDOR.XINFO.END.
> 
> Hope springs eternal for this novice perl scripter.  If you can't
> help me, but can refer me to another list which might - I'd
> appreciate that. 
> 
> Pat Gorden-Ozgul
> [EMAIL PROTECTED] / [EMAIL PROTECTED]
  You might look at the format statement and write to accomplish what you
need. If you have Learning Perl, look at chapter 11 Formats ( 2nd Edition ).
Programming Perl Chapter 7 Formats ( 3rd Edition ). This would be the
starting place for you.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



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




Re: How to send an e-mail from perl script on windows using SMTP?

2003-02-06 Thread dan
I tried telnetting to that host on port 25, it exclaimed "host could not be
found". Seems that's your problem.

With regards to NET::SMTP and Net::SMTP, since it's on windows, case doesn't
really seem to matter.

Dan

"Madhu Reddy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>  I did telnet ..i got following error
>
> -
> C: telnet ivhpxc0003.ap.bdi.gte.com 25
> Connecting To ivhpxc0003.ap.bdi.gte.com...Could not
> open a connection to host on port 25 : Connect failed
>
> C:telnet ivhpxc0003.ap.bdi.gte.com
> Connecting To ivhpxc0003.ap.bdi.gte.com...Could not
> open a connection to host: Connect failed
>
> -
>
> what couldbe the error ?
>
> Thanx
> -Madhu
>
>
>
>
> --- Timothy Johnson <[EMAIL PROTECTED]> wrote:
> >
> > Assuming that ivhpxc0003.ap.bdi.gte.com is your
> > email server, I would first
> > try to do a "telnet ivhpxc0003.ap.bdi.gte.com 25" at
> > the command prompt.  If
> > you get a connection refused or denied message, then
> > you will not be able to
> > send the email from your script.
> >
> > -Original Message-
> > From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, February 05, 2003 6:11 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Re: How to send an e-mail from perl script
> > on windows using
> > SMTP?
> >
> >
> > I changed to Net::SMTP
> > still i am getting following error
> >
> > Couldnt make Connection: Unknown error
> >
> >
> >
> > --- david <[EMAIL PROTECTED]> wrote:
> > > Madhu Reddy wrote:
> > >
> > > > use NET::SMTP ;
> > >
> > > should probably be:
> > >
> > > use Net::SMTP;
> > >
> > > unless NET::SMTP is a new module.
> > >
> > > david
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> >
> > __
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > http://mailplus.yahoo.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]
> >
>
>
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com



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




do statement

2003-02-06 Thread Benjamin Jeeves
Hi all

I have a statement a bit like this

while (  )
{
do "netbios.pl";
do "udp_port137.pl";
and so on

but the second do statement does not execute can anyone tell me why? 
-- 
Thank You



Benjamin Jeeves

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




RE: How to send an e-mail from perl script on windows using SMTP?

2003-02-06 Thread Timothy Johnson

Are you absolutely sure that this is your email server?  Are you using a
program like Outlook or Outlook Express, Eudora, Netscape Mail, etc?  If so,
you should be able to look in your settings for that program to find the
SMTP server that it is using.

-Original Message-
From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 06, 2003 6:49 AM
To: Timothy Johnson; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: How to send an e-mail from perl script on windows using
SMTP?


Hi,
 I did telnet ..i got following error

-
C: telnet ivhpxc0003.ap.bdi.gte.com 25
Connecting To ivhpxc0003.ap.bdi.gte.com...Could not
open a connection to host on port 25 : Connect failed

C:telnet ivhpxc0003.ap.bdi.gte.com
Connecting To ivhpxc0003.ap.bdi.gte.com...Could not
open a connection to host: Connect failed

-

what couldbe the error ?

Thanx
-Madhu




--- Timothy Johnson <[EMAIL PROTECTED]> wrote:
> 
> Assuming that ivhpxc0003.ap.bdi.gte.com is your
> email server, I would first
> try to do a "telnet ivhpxc0003.ap.bdi.gte.com 25" at
> the command prompt.  If
> you get a connection refused or denied message, then
> you will not be able to
> send the email from your script.
> 
> -Original Message-
> From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 05, 2003 6:11 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: How to send an e-mail from perl script
> on windows using
> SMTP?
> 
> 
> I changed to Net::SMTP
> still i am getting following error
> 
> Couldnt make Connection: Unknown error
> 
> 
> 
> --- david <[EMAIL PROTECTED]> wrote:
> > Madhu Reddy wrote:
> > 
> > > use NET::SMTP ;
> > 
> > should probably be:
> > 
> > use Net::SMTP;
> > 
> > unless NET::SMTP is a new module.
> > 
> > david
> > 
> > -- 
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.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]
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: how to set up Makefile.pl

2003-02-06 Thread Paul Tremblay

Thanks Bob, and thanks RF. I used seek and tell, and now have the data
as part of a module. 

Paul


On Wed, Feb 05, 2003 at 05:13:24PM -0500, Bob Showalter wrote:
> From: Bob Showalter <[EMAIL PROTECTED]>
> To: 'Paul Tremblay' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: RE: how to set up Makefile.pl
> Date: Wed, 5 Feb 2003 17:13:24 -0500 
> 
> Paul Tremblay wrote:
> > Thanks, but this won't work. I need to open the data file and read
> > some data. Later in the script, I need to open the data file again
> > and read more data. When I use  , perl apparently reads one
> > line at a time until it finds what I want. It then starts at the line
> > I left off when I need to read more data. It does not start at the
> > beginning again, so I cannot find the data I need. 
> > 
> > The only solution I can think using the __DATA__ method would be to
> > have my script print out *all* data to a temporary file. I could then
> > open and close this file when I wanted data. But this seems like kind
> > of a hack--and it would take a bit more time, though only a second or
> > two. 
> 
> Two alternate approaches:
> 
> 1) read the data into a memory structure (array or hash)
> 
> 2) use tell()/seek() on the DATA file handle to move around. 
> 
> n.b. seek(DATA, 0, SEEK_SET) does not put you at the first line after
> __DATA__, it puts you at the top of your script file. So use tell() to mark
> the start point before you start reading.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 


*Paul Tremblay *
*[EMAIL PROTECTED]*


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




Re: text manipulation scenario...

2003-02-06 Thread Rob Dixon
Patricia E Gorden-Ozgul wrote:
> I need to construct a working printf statement where each field in a
> given record would print at a specified position.

Hi Pat.

I've been amusing myself with your problem for an hour or so, and
although I don't in general approve of handing out ready-made
solutions I might as well let you have this. My answer was going
to be of the form 'I wouldn't start from here if I were you' which
wouldn't have been too helpful.

The script is attached, and I think it's fairly straightforward, but
you'd better come back with any questions you have rather than
me guessing what isn't clear to you. It uses symbolic references
to manipulate the data inglobal hashes, so I expect I'll be in
trouble with others on this list. Ah well!

I've also thrown in a format as David suggested so you can see how
they work. The output matches what you would have got with
the printf call in your original code. If you want to see all of the
data as it's pulled in, change line 36 that says 'write STDOUT' to
'dump_data' instead.

Hope this helps. It kept me quiet for a while anyway!

Cheers,

Rob



begin 666 pat.pl
M=7-E('-TTQ)3D5]
M#0I]#0HN#0H-"B1\*RL[(" @(" @(",@875T;V9L=7-H#0H-"F]U2 D:&%S:#L-"@T*
M0$%21U8]("=V96YDPT*(" @(&-H;VUP
M.PT*(" @(&UY("@D9FEE;&0L("1V86QU92D@/2!S<&QI=" G("2 DPT*(" @(" @(" @(" @)&AAPT*(" @(" @("!PR1H87-H?2D@>PT*(" @(" @(" @(" @<')I;G1F("(E,39S
G.B E


Re: How to send an e-mail from perl script on windows using SMTP?

2003-02-06 Thread wiggins


On Thu, 6 Feb 2003 17:09:40 -, "dan" <[EMAIL PROTECTED]> wrote:

> I tried telnetting to that host on port 25, it exclaimed "host could not be
> found". Seems that's your problem.
> 

Not necessarily, unless you are on the same local network as him. He could have an 
internal route/DNS available behind a firewall that you should never even know about 
and would never be able to use from outside of it, but to him the DNS and route are 
perfectly acceptable. Which brings up another point/question, is the script he is 
running remote or local?  Even if his local mail client uses that mail host, if the 
script is in a remote location, it *may not* have access to that same server

http://danconia.org

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




Re: do statement

2003-02-06 Thread Rob Dixon
Benjamin Jeeves wrote:
> Hi all
>
> I have a statement a bit like this
>
> while (  )
> {
> do "netbios.pl";
> do "udp_port137.pl";
> and so on
>
> but the second do statement does not execute can anyone tell me why?

The program will halt if netbios.pl has an 'exit' or 'die' statement,
but
it's also silent if it fails. If the file can't be opened or won't
compile
there will be an error message in $! or $@ respectively, so check
these after each 'do':

do "netbios.pl";
if (my $error = $! || $@) { die $error };

HTH,

Rob






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




How does one print blocks of text ..

2003-02-06 Thread Jamie Risk
... without encapsulating each line in double quotes? I've seen this, and
don't know where.




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




Re: How to send an e-mail from perl script on windows using SMTP?

2003-02-06 Thread Madhu Reddy
This script is running where my e-mail client is
(MicroSoft Look)...
I am not running on remote..
I am running on localNetwork

I am using Microsoft Outlook 2002
I used following procedure to get the my-email server
name
-
1. On Outlook "Tools>options>Mail
Setup===>E-mail Accounts==>view existing E-mail
Accounts==
==>microsoft exchange server==>"Double click on
Microsoft exchange server"==

I got following 

IVHPXC0003


Then i did ping...I got some IP address

then I did nslookup
then I got the following host name

ivhpxc0003.ap.bdi.gte.com

Is this is not my SMTP server ?

what could be the reasons for not getting the
connection.

Then i setup the debug option.

After that i got following error
=
 Couldnt make Connection: Unknown error
===

How to set debug option
is following is correct...
following is my script

-
sub send_mail { 
my ( $to, $from, $subject , @body)=@_ ;

use Net::SMTP ; 

my $relay='ivhpxc0003.ap.bdi.gte.com';
print "relay is : $relay\n";
my $smtp=Net::SMTP->new($relay, 
Hello => '[EMAIL PROTECTED]',
Timeout => 30,
Debug => 1) ;
print "SMTP is : $smtp\n";
die " Couldnt make Connection: $!\n"  if
(! defined $smtp)  ;
$smtp->mail($from) ;
$smtp->to($to);
$smtp->data();
$smtp->datasend("TO: $to\n");
$smtp->datasend("From: $from\n");
$smtp->datasend("Subject: $subject \n");
$smtp->datasend ("\n" ) ;
foreach (@body) {
$smtp->datasend("$_ \n") ;
   }
$smtp->dataend() ; 
$smtp->quit ; 
   }

   @body=( "This is a TEST MESSAGE" ) ;
   
&send_mail('[EMAIL PROTECTED]','[EMAIL PROTECTED]',
"hello", @body);







--- [EMAIL PROTECTED] wrote:
> 
> 
> On Thu, 6 Feb 2003 17:09:40 -, "dan"
> <[EMAIL PROTECTED]> wrote:
> 
> > I tried telnetting to that host on port 25, it
> exclaimed "host could not be
> > found". Seems that's your problem.
> > 
> 
> Not necessarily, unless you are on the same local
> network as him. He could have an internal route/DNS
> available behind a firewall that you should never
> even know about and would never be able to use from
> outside of it, but to him the DNS and route are
> perfectly acceptable. Which brings up another
> point/question, is the script he is running remote
> or local?  Even if his local mail client uses that
> mail host, if the script is in a remote location, it
> *may not* have access to that same server
> 
> http://danconia.org
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: How does one print blocks of text ..

2003-02-06 Thread Jeff 'japhy' Pinyan
On Feb 6, Jamie Risk said:

>... without encapsulating each line in double quotes? I've seen this, and
>don't know where.

With a here-doc:

print << "END OF BLOCK";
stuff
END OF BLOCK

Or with a different quoting character:

  print qq{
  this text is nice
  isn't it?
  };

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
 what does y/// stand for?   why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


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




RE: How to send an e-mail from perl script on windows using SMTP?

2003-02-06 Thread Timothy Johnson

It sounds like your network administrator might not be allowing you to use
the SMTP relay internally on your Exchange server.  You'll probably have to
take that up with him/her.  Exchange is different from SMTP but does support
SMTP.

-Original Message-
From: Madhu Reddy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 06, 2003 11:03 AM
To: [EMAIL PROTECTED]; dan; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: How to send an e-mail from perl script on windows using
SMTP?


This script is running where my e-mail client is
(MicroSoft Look)...
I am not running on remote..
I am running on localNetwork

I am using Microsoft Outlook 2002
I used following procedure to get the my-email server
name
-
1. On Outlook "Tools>options>Mail
Setup===>E-mail Accounts==>view existing E-mail
Accounts==
==>microsoft exchange server==>"Double click on
Microsoft exchange server"==

I got following 

IVHPXC0003


Then i did ping...I got some IP address

then I did nslookup
then I got the following host name

ivhpxc0003.ap.bdi.gte.com

Is this is not my SMTP server ?

what could be the reasons for not getting the
connection.

Then i setup the debug option.

After that i got following error
=
 Couldnt make Connection: Unknown error
===

How to set debug option
is following is correct...
following is my script

-
sub send_mail { 
my ( $to, $from, $subject , @body)=@_ ;

use Net::SMTP ; 

my $relay='ivhpxc0003.ap.bdi.gte.com';
print "relay is : $relay\n";
my $smtp=Net::SMTP->new($relay, 
Hello => '[EMAIL PROTECTED]',
Timeout => 30,
Debug => 1) ;
print "SMTP is : $smtp\n";
die " Couldnt make Connection: $!\n"  if
(! defined $smtp)  ;
$smtp->mail($from) ;
$smtp->to($to);
$smtp->data();
$smtp->datasend("TO: $to\n");
$smtp->datasend("From: $from\n");
$smtp->datasend("Subject: $subject \n");
$smtp->datasend ("\n" ) ;
foreach (@body) {
$smtp->datasend("$_ \n") ;
   }
$smtp->dataend() ; 
$smtp->quit ; 
   }

   @body=( "This is a TEST MESSAGE" ) ;
   
&send_mail('[EMAIL PROTECTED]','[EMAIL PROTECTED]',
"hello", @body);







--- [EMAIL PROTECTED] wrote:
> 
> 
> On Thu, 6 Feb 2003 17:09:40 -, "dan"
> <[EMAIL PROTECTED]> wrote:
> 
> > I tried telnetting to that host on port 25, it
> exclaimed "host could not be
> > found". Seems that's your problem.
> > 
> 
> Not necessarily, unless you are on the same local
> network as him. He could have an internal route/DNS
> available behind a firewall that you should never
> even know about and would never be able to use from
> outside of it, but to him the DNS and route are
> perfectly acceptable. Which brings up another
> point/question, is the script he is running remote
> or local?  Even if his local mail client uses that
> mail host, if the script is in a remote location, it
> *may not* have access to that same server
> 
> http://danconia.org
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: How does one print blocks of text ..

2003-02-06 Thread Brent Michalski

print qq(
  This is all going to "be printed"
and so is this
and this\n
);

or

print< cc:   (bcc: Brent 
Michalski/STL/MASTERCARD) 
  Sent by: newsSubject:  How does one print blocks of 
text ..  
  <[EMAIL PROTECTED]

  org> 

   

   

  02/06/2003 12:48 

  PM   

  Please respond to

  "Jamie Risk" 

   

   





... without encapsulating each line in double quotes? I've seen this, and
don't know where.




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




module to encrypt TCP stream

2003-02-06 Thread Distribution Lists
Hi,
using IO:SOCKET I have written a server daemon that listens on a
particular port. Is there a module that I can use in my code to encrypt
traffic between the client and server ?

Thanks



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




Using PGP in a perl script

2003-02-06 Thread Hodgkinson, Bill (MED)
I am trying to use PGP to decrypt an encrypted file and store the
standard output of the decryption into several hashes so that I can use
the hashes in a password recall script.

Example:  if you put in a servers name it will tell you the password for
that server. the server will be associated with a group letter and group
letter will be associated to the password.  

my biggest issue is getting the decrypted file loaded in the hashes.

any help is appreciated.

Bill Hodgkinson
UNIX Systems Administrator 
Head Quarters Global Operations
g  GE Medical Systems
___
I Don't know where I am going but there's no sense in being late!  No
matter where you go, there you are.


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




Quoted and unquoted spilts

2003-02-06 Thread Jamie Risk
How would I split, then push onto a list a variable length text string
with quoted portions (example following) so that a split keeps text
in quotes together.

  "keep me together" separate1 separate2 separate3 "keep me together too"
separate4

If the above were parsed, I should like to see six separate elements.
Using 'split' with no parameters understandably gives me eleven elements.




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




Re: Quoted and unquoted spilts

2003-02-06 Thread Jamie Risk
Never mind, although perhaps someone can explain what "split(/''/)" is
doing. It satisfies my needs, but I don't know why (emphasis on the '' bit
between the / /).




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




RE: Quoted and unquoted spilts

2003-02-06 Thread Bob Showalter
Jamie Risk wrote:
> How would I split, then push onto a list a variable length text string
> with quoted portions (example following) so that a split keeps text
> in quotes together. 
> 
>   "keep me together" separate1 separate2 separate3 "keep me together
> too" separate4
> 
> If the above were parsed, I should like to see six separate elements.
> Using 'split' with no parameters understandably gives me
> eleven elements.

You really can't do this with split(). Use the Text::CSV_XS module from CPAN
instead.



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




Having problems with unpack and negative numbers.

2003-02-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a number of files which I have transferred from another
system. I am trying to read the data, but running into a problem when I hit
what is a negative number (Each field is 4 characters in length).

Here is the unpack:

@MyWorka = unpack("a8Nsa6a10ssa52H8a4H8H8a136",$fb010dbuf);

This is the closest I have been able to get the info.  If the value is
positive, number is okay, but if negative, then just a huge number.  If you
look at rcd#3 Bill, you will see what I mean. If i I enter that value and
use printf and hex ( another script ), I get the negative number I expect.

What am I missing?

Thanks.

Wags ;)

Data:

rcd#:2
Orig: 0/
filr: 31bf
Dest: 0/
Bill: 12735/31bf
MyKey: 43693706
***
rcd#:3
Orig: 0/
filr: ce41
Dest: 0/
Bill: 4294954561/ce41
MyKey: 43693706
***
rcd#:4
Orig: 0/
filr: 380f
Dest: 0/
Bill: 14351/380f
MyKey: 43693706



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



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




Re: How does one print blocks of text ..

2003-02-06 Thread Rob Dixon
Jeff 'Japhy' Pinyan wrote:
> On Feb 6, Jamie Risk said:
>
>> ... without encapsulating each line in double quotes? I've seen
>> this, and don't know where.
>
> With a here-doc:
>
> print << "END OF BLOCK";
> stuff
> END OF BLOCK

Note that the quotes around the end marker string affect how the
body of text is interpolated. If you have double quotes like this
then the block is in double-quote context and variables will be
interpolated. if the marker is in single quotes then, likewise,
the context is a single-quote one and all variable names will
remain intact.

You can leave out the quotes altogether, when the context
is a double-quote one but there can be no spaces in the
initial statement, either in the marker or after the <<,
like this:

print <


RE: Quoted and unquoted spilts

2003-02-06 Thread Bob Showalter
Bob Showalter wrote:
> Jamie Risk wrote:
> > How would I split, then push onto a list a variable length text
> > string with quoted portions (example following) so that a split
> > keeps text in quotes together. 
> > 
> >   "keep me together" separate1 separate2 separate3 "keep me
> > together too" separate4 
> > 
> > If the above were parsed, I should like to see six separate
> > elements. Using 'split' with no parameters understandably gives me
> > eleven elements.
> 
> You really can't do this with split(). Use the Text::CSV_XS module
> from CPAN instead.
> 
> 

Just for kicks, here's a way to do it using split(). Text::CSV_XS is still
recommended, as it can deal with unbalanced quotes, escaped embedded quotes,
etc.

$ perl -le 'print for map { /"(.*)"/ ? $1 : split " ", $_ } split /(".*?")/,
q["keep me together" separate1 separate2 separate3 "keep me together too"
separate4]'

Output:
keep me together
separate1
separate2
separate3
keep me together too
separate4


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




Re: Having problems with unpack and negative numbers.

2003-02-06 Thread Rob Dixon
David --- Senior Programmer Analyst --- Wgo Wagner wrote:
> I have a number of files which I have transferred from another
> system. I am trying to read the data, but running into a problem when
> I hit what is a negative number (Each field is 4 characters in
> length).
>
> Here is the unpack:
>
> @MyWorka =
> unpack("a8Nsa6a10ssa52H8a4H8H8a136",$fb010dbuf);
>
> This is the closest I have been able to get the info.  If the value is
> positive, number is okay, but if negative, then just a huge number.
> If you look at rcd#3 Bill, you will see what I mean. If i I enter
> that value and use printf and hex ( another script ), I get the
> negative number I expect.
>
> What am I missing?

Hi David. I assume you mean the 'N' field? This is an unsigned 32-bit
big-endian value, so it will always be positive. You can try 'l'
(small el) which is a signed 32-bit value, but depending on your
platform architecture it may not process the bytes in the right order.
If not, you can just twos-complement your positive number
depending on the sign bit:

sub correct_sign {
($_[0] ^= 0x) += 1 if $_[0] & 0x8000;
}

Note that this modifies its parameter 'in place' and so must be
called with a scalar variable as its parameter.

Cheers,

Rob




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




Re: Quoted and unquoted spilts

2003-02-06 Thread Rob Dixon
Bob Showalter wrote:
> Just for kicks, here's a way to do it using split(). Text::CSV_XS is
> still recommended, as it can deal with unbalanced quotes, escaped
> embedded quotes, etc.
>
> $ perl -le 'print for map { /"(.*)"/ ? $1 : split " ", $_ } split
> /(".*?")/, q["keep me together" separate1 separate2 separate3 "keep
> me together too" separate4]'

Now that's /neat/! At first I thought it was horribly obscure with a
capture in the 'split' regex, until I realised what it did. I've never
come across that before, but it's right there in the documentation:

perldoc -f split

If the PATTERN contains parentheses, additional list
elements
are created from each matching substring in the delimiter.

split(/([,-])/, "1-10,20", 3);

produces the list value

(1, '-', 10, ',', 20)

Thanks Bob.



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




Unix vs DOS EOL ...

2003-02-06 Thread Jamie Risk
Okay, I do know that binary transfer of a text file between DOS and Unix
systems is a non-non, but my Samba setup isn't that discriminating.

Perl is running on a Unix platform, and 'chomp' isn't quite up to the task
of removing CR (ASCII '\r' or 0x0D).
So I tried:
  s/(.+)[ \t\n\r]*/$1/
but those tricky little CR are still there. Even
  s/(.+)[ \t\n\r\015]*/$1/
still eludes me.

Someone please explain the source of my confusion.




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




Re: Unix vs DOS EOL ...

2003-02-06 Thread Jamie Risk
> So I tried:
>   s/(.+)[ \t\n\r]*/$1/
> but those tricky little CR are still there. Even
>   s/(.+)[ \t\n\r\015]*/$1/
> still eludes me.

And then I tried:
  s/([^\n\r]+)[ \t\n\r]*$/$1/;
which does work, but seems overly finicky to get rid of BG's legacy. Is
there a better way?




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




RE: Unix vs DOS EOL ...

2003-02-06 Thread Kipp, James
>
> 
> Okay, I do know that binary transfer of a text file between 
> DOS and Unix
> systems is a non-non, but my Samba setup isn't that discriminating.
> 
> Perl is running on a Unix platform, and 'chomp' isn't quite 
> up to the task
> of removing CR (ASCII '\r' or 0x0D).
> So I tried:
>   s/(.+)[ \t\n\r]*/$1/
> but those tricky little CR are still there. Even
>   s/(.+)[ \t\n\r\015]*/$1/
> still eludes me.
> 

here is what works for me:
win2unix:  tr/\015//
unix2win:  s#\012#\015\012#g


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




Re: sasdata set

2003-02-06 Thread Jean Roth
I would suggest Stat/Transfer, www.stattransfer.com or DBMS/Copy.

Best,

Jean Roth
National Bureau of Economic Research
www.nber.org/data


Date: Thu, 6 Feb 2003 11:30:19 -0500 (EST)
From: Benjamin Jurado <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: sasdata set

can anyone point in the direction of converting sasdata sets into text
files? 
thanks


-- 
Benjamin F. Jurado
IT&E 
GMU




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




Re: How to send an e-mail from perl script on windows using SMTP?

2003-02-06 Thread Jenda Krynicky
From: "dan" <[EMAIL PROTECTED]>
> With regards to NET::SMTP and Net::SMTP, since it's on windows, case
> doesn't really seem to matter.
> 
> Dan

Wrong. There are some modules that do not care whether you use the 
right case, but most modules will not work correctly.

The reason is that the use statement not only loads and compiles the 
module - which would work fine under Windows even if you wrote
use nEt::sMtp;
- but also to let the module export some symbols into your package, 
make some initialization and so forth.

To do this Perl tries to call the import() subroutine (method) of the 
package. And since package names ARE case sensitive, it will fail to 
find it. It will not report an error, but the subroutines, constants 
and variables will NOT be imported.

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: Unix vs DOS EOL ...

2003-02-06 Thread Bob Showalter
Jamie Risk wrote:
> Okay, I do know that binary transfer of a text file between DOS and
> Unix systems is a non-non, but my Samba setup isn't that
> discriminating. 
> 
> Perl is running on a Unix platform, and 'chomp' isn't quite up to the
> task of removing CR (ASCII '\r' or 0x0D).

It is if you set $/="\r\n"

> So I tried:
>   s/(.+)[ \t\n\r]*/$1/
> but those tricky little CR are still there. Even
>   s/(.+)[ \t\n\r\015]*/$1/
> still eludes me.
> 
> Someone please explain the source of my confusion.

Because a dot (.) matches \r, the (.+) gobbles up your \r so that the
character class that follows can't match it. No backtracking is required,
since you use '*' (match zero or more) on your character class. Changing the
* to a + should make it work. But there are simpler ways:

To strip a trailing \r, the simple

   s/\r$//;

should suffice.

You've could also use

   tr/\r//d;

which removes \r's anywhere in the string, not just at the end.

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




modify the first few lines of a file

2003-02-06 Thread sashidhar
Hello,
I am dealing with text files of sizes > 2 GB. I have to modify just the top 2 lines
of such files. Is there a way in Perl to modify just the first 'n' lines of the file
without having to process rest of the file as it involves a lot of IO and time. 

Thanks,
Siva.

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




multi do statements

2003-02-06 Thread Benjamin Jeeves
Hi All

When I run this code it will execute the first do statement but does not 
execute the 2.3.4 do statment but it show me no errors I can see no errors 
can you help
while (  )
{
unless ($return = do $udpport137)
{
warn "couldn't parse $udpport137 : $@"  if $@;
warn "couldn't do file $udpport : $!"   unless defined 
$return;
warn "couldn't run $udpport137" unless $return;
}
unless ($return = do $netbios)
{
warn "couldn't parse $netbios : $@" if $@;
warn "couldn't do file $netbios : $!"   unless defined 
$return;
warn "couldn't run $netbios"unless $return;
}
unless ($return = do $icmpalert)
{
warn "couldn't parse $icmpalert : $@"   if $@;
warn "couldn't do file $icmpalert : $!" unless defined 
$return;
warn "couldn't run $icmpalert"  unless $return;
}
unless ($return = do $getglobal)
{
warn "couldn't parse $getglobal : $@"   if $@;
warn "couldn't do file $getglobal : $!" unless defined 
$return;
warn "couldn't run $getglobal"  unless $return;
}
more code follows but that works.
-- 
Thank You



Benjamin Jeeves

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




Re: text manipulation scenario...

2003-02-06 Thread John W. Krahn
Patricia E Gorden-Ozgul wrote:
> 
> I need to construct a working printf statement where each field in a given
> record would print at a specified position.
> 
> Each record may or may not contain any particular field but will always
> begin with .VENDOR.LIBRARY. and end with .VENDOR.XINFO.END.
> 
> Hope springs eternal for this novice perl scripter.  If you can't help me,
> but can refer me to another list which might - I'd appreciate that.
> 
> Pat Gorden-Ozgul
> [EMAIL PROTECTED] / [EMAIL PROTECTED]
> 
> A sample from the datafile:
> 
> .VENDOR_LIBRARY. BNL-MAIN
> .VENDOR_ID. 070001
> .VENDOR_NAME. Research Books, Inc. / scholium
> .VENDOR_GROUP2. DOMESTIC
> .VENDOR_ADDR1_BEGIN.
> .PHONE. 800 445 7359   203 245 3279
> .FAX. 203 245 1830
> .LINE. 38 Academy Street
> .CITY. Madison
> .STATE. Ct
> .ZIP. 06443
> .VENDOR_ADDR1_END.
> .VENDOR_ADDR2_BEGIN.
> .LINE. 38 Academy Street
> .CITY. Madison
> .STATE. Ct
> .ZIP. 06443
> .VENDOR_ADDR2_END.
> .VENDOR_XINFO_BEGIN.
> .PAYTO. Research Books, Inc. / scholium
> .VENDOR_XINFO_END.
> 
> .VENDOR_LIBRARY. BNL-MAIN
> .VENDOR_ID. 070097
> .VENDOR_NAME. Aspen Publishers Inc.
> .VENDOR_GROUP2. DOMESTIC
> .VENDOR_ADDR1_BEGIN.
> .PHONE. (800)234-1660
> .LINE. 7201 McKinney Circle
> .CITY. Frederick
> .STATE. MD
> .ZIP. 21704
> .VENDOR_ADDR1_END.
> .VENDOR_ADDR2_BEGIN.
> .ATTN. Accounts Receivable
> .LINE. P.O. Box 64054
> .CITY. Baltimore
> .STATE. MD
> .ZIP. 21264-4054
> .VENDOR_ADDR2_END.
> .VENDOR_XINFO_BEGIN.
> .PAYTO. Aspen Publishers Inc.
> .VENDOR_XINFO_END.
> 
> .VENDOR_LIBRARY. BNL-MAIN
> .VENDOR_ID. 070014
> .VENDOR_NAME. John Wiley and Sons, Inc.
> .VENDOR_GROUP2. DOMESTIC
> .VENDOR_ADDR1_BEGIN.
> .ATTN. Order Department
> .LINE. Eastern Distribution Center
> .LINE2. One Wiley Drive
> .CITY. Somerset
> .STATE. NJ
> .ZIP. 08875
> .COUNTRY. USA
> .PHONE. (800) 225-5945
> .VENDOR_ADDR1_END.
> .VENDOR_ADDR2_BEGIN.
> .ATTN. John Wiley & Sons, Inc.
> .LINE. P.O. Box 18684
> .CITY. Newark
> .STATE. NJ
> .ZIP. 07191-8684
> .COUNTRY. USA
> .PHONE. (908) 469-4400
> .VENDOR_ADDR2_END.
> .VENDOR_XINFO_BEGIN.
> .PAYTO. John Wiley & Sons, Inc.
> .VENDOR_XINFO_END.
> 
> .VENDOR_LIBRARY. BNL-MAIN
> .VENDOR_ID. 070001
> .VENDOR_NAME. Research Books, Inc. / scholium
> .VENDOR_GROUP2. DOMESTIC
> .VENDOR_ADDR1_BEGIN.
> .PHONE. 800 445 7359   203 245 3279
> .FAX. 203 245 1830
> .LINE. 38 Academy Street
> .CITY. Madison
> .STATE. Ct
> .ZIP. 06443
> .VENDOR_ADDR1_END.
> .VENDOR_ADDR2_BEGIN.
> .LINE. 38 Academy Street
> .CITY. Madison
> .STATE. Ct
> .ZIP. 06443
> .VENDOR_ADDR2_END.
> .VENDOR_XINFO_BEGIN.
> .PAYTO. Research Books, Inc. / scholium
> .VENDOR_XINFO_END.
> 
> .VENDOR_LIBRARY. BNL-MAIN
> .VENDOR_ID. 070001
> .VENDOR_NAME. Research Books, Inc. / scholium
> .VENDOR_GROUP2. DOMESTIC
> .VENDOR_ADDR1_BEGIN.
> .PHONE. 800 445 7359   203 245 3279
> .FAX. 203 245 1830
> .LINE. 38 Academy Street
> .CITY. Madison
> .STATE. Ct
> .ZIP. 06443
> .VENDOR_ADDR1_END.
> .VENDOR_ADDR2_BEGIN.
> .LINE. 38 Academy Street
> .CITY. Madison
> .STATE. Ct
> .ZIP. 06443
> .VENDOR_ADDR2_END.
> .VENDOR_XINFO_BEGIN.
> .PAYTO. Research Books, Inc. / scholium
> .VENDOR_XINFO_END.
> 
> The code:
> 
> 
> # script:  peoplesoft_vendors.pl
> # author:  PGO
> # description:  Generate PeopleSoft 'VN'vendor batch file
> #   from API output
> # date:  01/31/03
> 

You should enable warnings and strict when developing your code.

use warnings;
use strict;


> my $file_in = 'vendshrt';
> 
> my $library = ".VENDOR_LIBRARY. ";
 ^  ^
> my $library_out = " ";
> my $id = ".VENDOR.ID. ";
^ ^
> my $id_out = " ";
> my $name = ".VENDOR_NAME. ";
  ^   ^
> my $name_out = " ";
> my $payto = ".PAYTO. ";
   ^ ^
> my $payto_out = " ";
> my $group2 = ".VENDOR_GROUP2. ";
^ ^
> my $group2_out = " ";
> my $phone1 = ".PHONE. " ;
^ ^
> my $phone1_out = " ";
> my $fax = ".FAX. ";
 ^   ^
> my $fax_out = " ";
> my $addr1_line = ".LINE. ";
^^
You are using these strings as regular expressions however the dot is
special in regular expressions, it matches ANY character (except
newline.)  It would be more efficient to use the qr// operator to
compile the regular expressions before using them.


> my $addr1_line_out = " ";
> 
> my $blank8 = "";
> 

> open(DATA, "$file_in") || die ;
 ^^
Putting quotes around single variables is almost always wrong.

perldoc -q quoting


>   while ()

You need to put the the current line in the $line variable for the
subsequent lines to work.

while ( my $line =  )

>   {
>  chomp ($line);
> # debug
> # print "this line is: $_";
> 
>  if ($line =~ /$library/)
>  {
> $line =~ s/$library//g;

There is no need to do a match AND substitution.  The /g (global match)
option is not required.

Re: Quoted and unquoted spilts

2003-02-06 Thread Jeff 'japhy' Pinyan
On Feb 6, Jamie Risk said:

>How would I split, then push onto a list a variable length text string
>with quoted portions (example following) so that a split keeps text
>in quotes together.
>
>  "keep me together" separate1 separate2 separate3 "keep me together too"
>separate4
>
>If the above were parsed, I should like to see six separate elements.
>Using 'split' with no parameters understandably gives me eleven elements.

Don't use split().

  my @parts = $str =~ m{".*?"|\S+}g;

If you want to remove the quotes, then you could do this afterwards:

  s/^"// and s/"$// for @parts;

Or, you could do the first one this way:

  my @parts = grep defined, $str =~ m{"(.*?)"|(\S+)}g;

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
 what does y/// stand for?   why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


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




Re: modify the first few lines of a file

2003-02-06 Thread John W. Krahn
Sashidhar wrote:
> 
> Hello,

Hello,

> I am dealing with text files of sizes > 2 GB. I have to modify just the top 2 lines
> of such files. Is there a way in Perl to modify just the first 'n' lines of the file
> without having to process rest of the file as it involves a lot of IO and time.

It depends.  If the modifications don't change the length of the file
then you can do it.  If the modifications increase or decrease the
length of the file then you have to process the entire file.


John
-- 
use Perl;
program
fulfillment

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




Re: modify the first few lines of a file

2003-02-06 Thread sashidhar
I may have to change the length of the files. Is there no way, like manipulating the
inode entries to reflect any changes in the length. Ofcourse, I realize that this is
specific to the linux/unix env. 

--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> Sashidhar wrote:
> > 
> > Hello,
> 
> Hello,
> 
> > I am dealing with text files of sizes > 2 GB. I have to modify just the top 2
> lines
> > of such files. Is there a way in Perl to modify just the first 'n' lines of the
> file
> > without having to process rest of the file as it involves a lot of IO and time.
> 
> It depends.  If the modifications don't change the length of the file
> then you can do it.  If the modifications increase or decrease the
> length of the file then you have to process the entire file.
> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: Using PGP in a perl script

2003-02-06 Thread Wiggins d'Anconia
A bit confused...

Hodgkinson, Bill (MED) wrote:

I am trying to use PGP to decrypt an encrypted file and store the
standard output of the decryption into several hashes so that I can use
the hashes in a password recall script.



Are you saying you want to call pgp command line and store what it 
prints to STDOUT (messages, etc.) to the hash, or you want to store the 
decrypted/encrypted text to the hashes? Why would you store the whole 
decrypted file into the hash, or more specifically how do you intend to 
store it across multiple hash keys?

Example:  if you put in a servers name it will tell you the password for
that server. the server will be associated with a group letter and group
letter will be associated to the password.  

my biggest issue is getting the decrypted file loaded in the hashes.

any help is appreciated.


Does the decrypted file contain the contents (one per line, for 
instance) of what you are storing???

If you can post more specifics/examples, what you have tried, etc. more 
help can probably be provided.

http://danconia.org


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



Re: Using PGP in a perl script

2003-02-06 Thread Wiggins d'Anconia
p.s. Providing your version of PGP and what environment you are running 
this in may help as well. For instance GnuPG on Linux RH 8.0, NAI PGP on 
Win 2000


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



Beginners question for PERL

2003-02-06 Thread Clark, Mark

I have been looking to see if a port of
PERL (any PERL!) exists for the IPAQ.
Could someone tell me yay/nay/where?

What I have found so far is that PERL
makes it's way into these devices via
Linux.  Is this the only way?

Thanks in advance.

-- Mark

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




Re: Premature end of script headers

2003-02-06 Thread toplijst.org
That's it !

thanks,
Martin

- Original Message - 
From: "Rob Dixon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 06, 2003 3:28 PM
Subject: Re: Premature end of script headers


> Zegdatwel wrote:
> > hi,
> >
> > "Premature end of script headers"
> >
> > what can this mean...it's in the error log. When does this happen? I
> > got error 500 when executing script.
> 
> Check the permission settings on your script. try chmod 755.
> 
> HTH,
> 
> Rob
> 
> 
> 
> 
> -- 
> 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]




Tk::Balloon Question

2003-02-06 Thread Jim
Hello,

I've been having size problems with balloons.  In the example below,
the first balloon to appear is the size of my main window.  After that
balloon closes, future balloons are sized according to their contents.
In another script I'm working on, the balloons always stay the size of
the main window.

Can anyone advise me on getting balloons to show up properly the first
and every time?

Thanks,
Jim



use Tk;
use Tk::Balloon;

my $mw = MainWindow->new;

my $canvas = $mw->Canvas(
)->pack(
   -expand=>1,
   -fill=>'both',
);

my $id = $canvas->createText(5,5,
   -text => 'hello',
   -anchor=>'nw',
);
my %messages = ();
$messages{$id} = "there";

my $balloon = $canvas->Balloon();
$balloon->attach($canvas,
   -balloonposition => 'mouse',
   -msg => \%messages,
);

MainLoop();


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




Winamp::Control

2003-02-06 Thread David O'Dell
Has anyone used this?
It seems that rather than authenticating once and then keeping the same 
socket open for further commands it is looking to authenticate for every 
command, however other than the validate_password command I can't see 
where to put the password string in.
I've tried
$winamp = Winamp::Control->new( host => '192.168.62.162', port => 
'4800', password=>'winamp' );
$winamp->play;
but it fails,

when I try the same  command with my browser with the password it succeeds
http://192.168.62.162:4800/play?p=winamp


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



OT (Sort of): Amazon.com

2003-02-06 Thread Wiggins d'Anconia
I have noticed over the last year or so that Amazon.com likes to spam 
the jobs.perl.org list periodically, sometimes repetitively with the 
same job posting, and I am curious, has *anyone* in the Perl community 
actually been contacted by them?  Anyone outside of the Seattle area? 
Right now I am fairly content in my position, but like so many others am 
looking to move up (or in my case out) to a different position, and 
while there have been some financial reasons to doubt Amazon.com, the 
web moving forward is going to become stronger, and having a name like 
Amazon.com on your resume surely can't hurt, especially if you get to 
live in a better city

While I am no Larry Wall, Tim Bunce, etc. etc. etc. I feel my 
experience, education, etc. would warrant at least an e-mail, and how 
many Perl/Unix/database/Web experts with several years of experience, 
are there in the Seattle area (I am not in the Seattle area, and while I 
think (hope) my skills are getting advanced, I don't consider myself an 
expert)? And if there are that many, why the multiple postings for the 
same job?

What are the experiences with this??

http://danconia.org


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



Re: modify the first few lines of a file

2003-02-06 Thread John W. Krahn
Sashidhar wrote:
> 
> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> > Sashidhar wrote:
> > >
> > > I am dealing with text files of sizes > 2 GB. I have to modify just the top 2
> > > lines of such files. Is there a way in Perl to modify just the first 'n' lines
> > > of the file without having to process rest of the file as it involves a lot of
> > > IO and time.
> >
> > It depends.  If the modifications don't change the length of the file
> > then you can do it.  If the modifications increase or decrease the
> > length of the file then you have to process the entire file.
> 
> I may have to change the length of the files. Is there no way, like manipulating the
> inode entries to reflect any changes in the length. Ofcourse, I realize that this is
> specific to the linux/unix env.

The inode entry does not affect the actual data in the file.  If the
length of the file has to be changed then the entire file has to be
processed irregardless of which operating system (AFAIK) you are running
this on.


John
-- 
use Perl;
program
fulfillment

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




Re: Beginners question for PERL

2003-02-06 Thread Wiggins d'Anconia


Clark, Mark wrote:

I have been looking to see if a port of
PERL (any PERL!) exists for the IPAQ.
Could someone tell me yay/nay/where?

What I have found so far is that PERL
makes it's way into these devices via
Linux.  Is this the only way?



Running WinCE??

http://www.rainer-keuchel.de/wince/perlce.html

http://danconia.org


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




Re: OT (Sort of): Amazon.com

2003-02-06 Thread John W. Krahn
Wiggins D'Anconia wrote:
> 
> I have noticed over the last year or so that Amazon.com likes to spam
> the jobs.perl.org list periodically, sometimes repetitively with the
> same job posting, and I am curious, has *anyone* in the Perl community
> actually been contacted by them?

Perhaps you should post this on the perl.jobs.discuss mailing list
instead?


John
-- 
use Perl;
program
fulfillment

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




Re: OT (Sort of): Amazon.com

2003-02-06 Thread Wiggins d'Anconia
John W. Krahn wrote:

Wiggins D'Anconia wrote:


I have noticed over the last year or so that Amazon.com likes to spam
the jobs.perl.org list periodically, sometimes repetitively with the
same job posting, and I am curious, has *anyone* in the Perl community
actually been contacted by them?



Perhaps you should post this on the perl.jobs.discuss mailing list
instead?



See not an expert, hadn't found that list yet. :-)

http://danconia.org


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




regular expressions / clickable links in text

2003-02-06 Thread Hohokus Wombat
hi -

quick question:

i want to take a chunk of text and convert anything that's a link to 
something clickable in the browser. (this is being used in 'request 
tracker', if anyone's interested.)

there's already a chunk of code that does this:

sub print_html{
   my ($value) = shift;
   my %map = ('<' => '<', '>' => '>', '&' => '&');
   $value =~ s/([<>\&])/$map{$1}/ge;
   $value =~ s!(?:^|\b)
   ((?:https?|ftp|mailto)://[^\s\"\'/]+/[^\s():\"\']+)
  !$1!gx;
   print $value;
}

so, this will take vanilla text (e-mail, mainly) and convert anything that 
begins with http:// or so forth into a clickable link. it works well.

the only problem is that people often e-mail us with links to images, which 
include spaces in the filename. "http://test.org/this is a test.jpg" for 
example.

the above code stops at the first space.

is there any easy way to modify this to account for spaces? if it makes it 
any easier, the links are always on a single line, i.e. they all end with a 
newline.

any help appreciated. sure it's just a matter of changing a few characters..

thanks.
[EMAIL PROTECTED]

_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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



Re: a though question of using variable in pattern

2003-02-06 Thread R. Joseph Newton
Rob Dixon wrote:

> Hi again Kasi. Still not using /x ?  ;-)
>
> Look:
>
> print my $t="href=\"(.*?)\">";
> outputs
> href="(.*?)">

H.  this gets me thinking.  How does that translate into a regex when such a 
variable is passed in?  Would Perl do the escaping and feed the regex something like:

/href="\(\.\*\?\)\">/
then?

Joseph


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




Re: help please!

2003-02-06 Thread R. Joseph Newton
Benjamin Jeeves wrote:

> Hi All
>
> I have a require statement that is run by my main program but I get a error
> "did not return a true value at ./connecttime.pl line 26,  line
> 11811302." connecttime.pl is the main program and the script it is executing
> this to do pattern matching on the file that is passed to connecttime.pl can
> oneone tell me were I have gone wrong please
> --
> Thank You
>
> Benjamin Jeeves

You did not send any of your code, so I am going to base my guesswork on what is 
before me:

connecttime.pl is the main program and the script it is executing
this to do pattern matching on the file that is passed to connecttime.pl can
oneone tell me were I have gone wrong please

You have not said anything here.  I would suggest that you turn your code editor off 
for awhile, and concentrate on re-writing your plain-language description of what your 
program should do.  Write it one sententce at a time.  Then, and only then, try to 
write this as program code.

Joseph



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




Re: regular expressions / clickable links in text

2003-02-06 Thread Randal L. Schwartz
> "Hohokus" == Hohokus Wombat <[EMAIL PROTECTED]> writes:

Hohokus> i want to take a chunk of text and convert anything that's a link to
Hohokus> something clickable in the browser. (this is being used in 'request
Hohokus> tracker', if anyone's interested.)

Hohokus> there's already a chunk of code that does this:

There's a better chunk in the module URI::Find.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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