Re: WML header

2002-02-15 Thread Carl Franks

No problem fliptop, the link was Very Good.
Made a great start last night, and got my first cgi WAP site up and running.

Carl


 sorry, i think i accidentally cc'd you anyway.  my bad.


 

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




Re: Help with ODBC/CGI/IIS

2002-02-15 Thread Mark Bergeron

Not unless you purchase XP Pro. It also comes bundled with Win2K pro and of course 
Win2K Server. And BTW, i thought it was pretty crappy of MS not to have it for XP Home 
OR support PWS for XP Home. Oh well, Apache it is!

-Original Message-
From: Al Hospers[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Thu Feb 14 13:31:25 PST 2002
Subject: Help with ODBC/CGI/IIS

just out of curiosity...

where do you get IIS these days? at one time it was a d/l on the MS
site  it also came with my NT server. can you d/l IIS5 somewhere?

Al Hospers
CamberSoft, Inc.
alatcambersoftdotcom
http://www.cambersoft.com

Shockwave and Director development, CD-ROM, HTML,
CGI scripting, and Graphic Design.

A famous linguist once said:
There is no language wherein a double
positive can form a negative.

YEAH, RIGHT




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



___
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com



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




IE can't handle intput type=hidden...please help!!!

2002-02-15 Thread Evil Bag Piper

Hello,

I had made a post a few days ago about IE and AOL's browser not being
compatible with the script(s) I wrote.  Here's what I've been able to
find out so far in my troubleshooting.  If you have any suggestions
PLEASE send them!!!

I have built a site for our students to assess professors on their
ability to teach.  The site uses several CGI/Perl scripts.  One to
gather registration info, one to check their registration for proper
format, one to create questions, one to grade their questions/email them
their results.

The entire site works fine.  Data that is carried from one script to the
other is done so very well using the input type=hidden command right
before the submit button. The site works fine that is until the last
transition from the create questions script to the grading questions
script.  IE fails to carry all value pairs to next script/webpage.
Netscape works, IE doesnt.  Why?  IE carries some values over, but clips
that last 80% of them off...

I suppose I could open a temp text file and print information there then
go to next script/page and open that file and read information in..but
that seems like a long way around a short problem

PLEASE HELP!!!

Thanks,
Roger


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




Re: Q: About perlcc, How to make multi-platform file.

2002-02-15 Thread Randal L. Schwartz

 Itigo == Itigo  [EMAIL PROTECTED] writes:

Itigo Q: About perlcc, How to make multi-platform file.

By not trying to cc it.  Just leave it Perl.  Perl is multi-platform!

What were you hoping to accomplish by using perlcc?

Speedup?  Nah.  It's actually slower to start.
Hiding the source?  Evil.  Don't piss in the face of the rest of us.
Not having to install Perl?  Nope.  Still need the libraries.

So, why?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL: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]




regrex question

2002-02-15 Thread David Gilden



$key =Departure date;

$key =~ s/([\w\w+])/\u$1/;


--- Desired result:

Departure Date



What is wrong the above regrex?

Thanks!

Dave

**
*   Cora Connection Your West African Music Source   *  
*   http://www.coraconnection.com/   *  
*   Resources, Recordings, Instruments  More!   *
**

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




RE: my first C++ CGI won't work

2002-02-15 Thread online-batonrouge

According to your set-up, www.deepconnection.com will start looking in DocumentRoot,
i.e., C:/Apache/Apache Group/Apache/real_docs/deepconnection for web pages.

You then alias /cgi-bin/ to C:/Apache/Apache Group/Apache/cgi-bin/ for scripts.  As 
you can see,
this directory is not the one referenced in 
http://www.deepconnection.com/cgi-bin/hello.exe;

To use your current link, create and place cgi scripts in C:/Apache/Apache 
Group/Apache/real_docs/deepconnection/cgi-bin
Be sure to correct the script alias also: C:/Apache/Apache 
Group/Apache/real_docs/deepconnection/cgi-bin/




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




New on the Block

2002-02-15 Thread Sir Douglas Cook

Ok, I'll ask,
Where can I learn Regex syntax?

Ok, I'll ask, a completely different question:
I am using Windows98 sec PWS, I know UNlX and I have
a extra old 486 computer.
Where can I learn to set up a Apache Box or Lunix Box?

I haven't figured out which one I should pick yet

Please email me directly, as I do not want a OS war to start up.

Many Thanks in advance
[EMAIL PROTECTED] 


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




Spaces in form values -- cgi

2002-02-15 Thread David Gilden

Hi, 


Is it ok to have spaces in the value of a form element?


option value=kayak touring rescue techniquesKayak Touring Rescue 
Techniques/option


Or do I need to use underscores,

option value=kayak_touring_rescue_techniquesKayak Touring Rescue 
Techniques/option


Thanks

Dave

PS: TGIF!

**
*   Cora Connection Your West African Music Source   *  
*   http://www.coraconnection.com/   *  
*   Resources, Recordings, Instruments  More!   *
**

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




RE: Spaces in form values -- cgi

2002-02-15 Thread Hanson, Robert

Yeah, you will be fine with the spaces.

The browser may(?) URL encode them before sending them to the server.  So
your value will look like this when it hits the server:

kayak+touring+rescue+techniques

Or maybe this, which is equivelent:

kayak%20touring%20rescue%20techniques

When you use CGI.pm (or some other library), it will decode them for you.
So when you get it you won't see any spaces.

But frankly I'm not 100% sure if form data gets URL encoded anyway.  I think
it does, but I haven't analyzed form data for a long time... and you won't
need to either because the library you use will decode as needed anyway.

So yeah, use spaces!  (just not in URL's :) ...but that's another story)

Rob



-Original Message-
From: David Gilden [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 3:09 PM
To: [EMAIL PROTECTED]
Subject: Spaces in form values -- cgi


Hi, 


Is it ok to have spaces in the value of a form element?


option value=kayak touring rescue techniquesKayak Touring Rescue
Techniques/option


Or do I need to use underscores,

option value=kayak_touring_rescue_techniquesKayak Touring Rescue
Techniques/option


Thanks

Dave

PS: TGIF!

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




Re: Spaces in form values -- cgi

2002-02-15 Thread Brett W. McCoy

On Fri, 15 Feb 2002, David Gilden wrote:

 option value=kayak touring rescue techniquesKayak Touring Rescue 
Techniques/option

 Or do I need to use underscores,

 option value=kayak_touring_rescue_techniquesKayak Touring Rescue 
Techniques/option

I believe the spaces will get replaced with %20.  I question the necessity
of making the value of the option the same as the text you are displaying
(actually, if you don't specify a value, the text IS the value).  It would
be better to make the value something short, like 'KTRT' or some similar
mnemonic (like perhaps an id field you wouuld be looking up in a
database...)  It will make your life a lot easier.

-- Brett
  http://www.chapelperilous.net/

To err is human -- but it feels divine.
-- Mae West


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




RE: CGI Timeout

2002-02-15 Thread Bob Showalter

 -Original Message-
 From: Jeff [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 15, 2002 3:24 PM
 To: [EMAIL PROTECTED]
 Subject: CGI Timeout
 
 
 This may be as much a question about web servers as it is 
 about perl cgi.  Sorry if you find it inappropriate.
 I am having a hell of a time with CGI Timeouts on the client 
 side of things when I have database intensive, long-running 
 processes on the server side.  I have increased every single 
 timeout parameter I can think of.
 I am running IIS on a Windows 2000 server machine and 
 executing activeperl cgi scripts.  The scripts fun fine for 
 short requests via the browser and the scripts run just fine 
 if executed from the command line.  This is just a small 
 application for 10 or so users to execute database transactions.
 The CGI timeout error actually stops the process on the 
 server side.  I would at least like to get to a point where 
 the users may receive a timeout, but the perl cgi keeps 
 running on the server side until it successfully completes 
 its processing. There are WAY too many input variables for 
 this to be spawned as a seperate process via a system call. 
  The input array can sometimes be up to 4000 elements
 Any thoughts??
 Thanks,
 Jeff

Spawn the separate process with fork().

The parent can emit a response and exit, while the child
continues on with the processing.

merlyn also posted the following link a few days ago with a
fancier approach to this kind of problem:

http://www.stonehenge.com/merlyn/WebTechniques/col20.html

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




Re: String manipulation help needed

2002-02-15 Thread Andrea Holstein

In article [EMAIL PROTECTED] wrote Brett 
W. McCoy
[EMAIL PROTECTED]:

 On Thu, 14 Feb 2002, Brian Johnson wrote:
 
 I need a string in the form
 Wed, 18 Jul 2001 14:20

 Of course my line doesn't quite cut it.
   my $emaildate = join  , $record-{day}, $record-{month},
 $record-{year}, $record-{hour}, $record-{minute};
 
 Just interpolate the variables directly inside double quotes:
 
 my $emaildate = $record-{day}, $record-{month} $record-{year}
 $record-{hour}:$record-{minute};
 
Or if you like it a little bit shorter:

my $emaildate = $_-{day}, $_-{month} $_-{year} $_-{hour}:$_-{minute} for 
($record);

Greetings,
Andrea

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




Re: Urgent - Getting the left most 3 characters from a string...

2002-02-15 Thread Andrea Holstein

In article [EMAIL PROTECTED] wrote Chris [EMAIL PROTECTED]:

 ...
 Thanks!
 
 ...
  my $newresult = $result;
  print New Results - $$newresult\n;
  my $resultcode;
  print Result Code - $$resultcode;\n;
  if ($newresult = 200) {

Take Care: You surely meant
if ($newresult == 200) { ... }

(if ($newresult = 200) means
  assign 200 to $newresult,
  and go into the if-statement if another value than 0
  was assigned, what is the fact
)
  $resultcode = Code 200 - '\n;
  } elsif ($newresult = 400) {
  $resultcode = Code 400 - Bad Request\n;
  } elsif ($newresult = 403) {
  $resultcode = Code 403 - Forbidden\n;
  } elsif ($newresult = 404) {
  $resultcode = Code 404 - Not Found\n;
  } elsif ($newresult = 405) {
  $resultcode = Code 405 - Method Not Allowed\n;
  } elsif ($newresult = 406) {
  $resultcode = Code 406 - Not Acceptable\n;
  } elsif ($newresult = 407) {
  $resultcode = Code 407 - Proxy Authentication Required\n;
  } elsif ($newresult = 408) {
  $resultcode = Code 408 - Request Timeout\n;
  } elsif ($newresult = 409) {
  $resultcode = Code 409 - Conflict\n;
  } elsif ($newresult = 410) {
  $resultcode = Code 410 - Gone\n;
  } elsif ($newresult = 500) {
  $resultcode = Code 500 - Internal Server Error\n;
  } elsif ($newresult = 501) {
  $resultcode = Code 501 - Not Implemented\n;
  } elsif ($newresult = 502) {
  $resultcode = Code 502 - Bad Gateway\n;
  } elsif ($newresult = 503) {
  $resultcode = Code 503 - Service Unavailable\n;
  } elsif ($newresult = 504) {
  $resultcode = Code 504 - Gateway Timeout\n;
  } elsif ($newresult = 505) {
  $resultcode = Code 505 - HTTP Version Not Supported\n;
  } else {
  $resultcode = Unknown error...\n;
  }
  print \nNew Results Code - $resultcode\nNew Results -
 $newresult\nOld Results - $result;
  print DUMPFILE * $result\n;
  print DUMPFILE *\n;
  close (DUMPFILE);
 

I couldn't believe you really typed it in.
Every second line is reduntant (it must be VB-style:-))

However, I'd suggest a solution with a hash:
my %code_desc = (
200 = 'Access successful',
400 = 'Bad Request',
403 = 'Forbidden',
...
);

Then your code becomes much shorter:
$resultcode = $code_desc{$newresult} 
? Code $newresult - $code_desc{$newresult}\n
: Unknown Error;

---

Of course, if you are so lazy like me,
you can reduce the effort to define the hash, too:

my %code_desc = map {/(\d+) (.*)/; ($1 = $2}} spit /\n/, DESCRIPTION;
200 Access successful
400 Bad Request
403 Forbidden
...
DESCRIPTION


Best Wishes,
Andrea


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




Re:a better Perl way

2002-02-15 Thread Jorge Goncalvez

Hin I have this piece of code and i wanted to make it simpler and shorter Yhanks

my $Range1 = $1 . ($2 + 1) if $IPREAL[0] =~ /^(.*\.)(.+)$/;
my $Range2 = $1 . ($2 + 1) if $IPREAL[1] =~ /^(.*\.)(.+)$/;
my $Range3 = $1 . ($2 + 2) if $IPREAL[0] =~ /^(.*\.)(.+)$/;
my $Range4 = $1 . ($2 + 2) if $IPREAL[1] =~ /^(.*\.)(.+)$/;

my $newline2=  subnet $IP[0] netmask 255.255.255.0{range dynamic-bootp  
$Range1 $Range3;};
my $newline3=  subnet $IP[1] netmask 255.255.255.0{range dynamic-bootp 
$Range2 $Range4;};

 Thanks.   


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




$|

2002-02-15 Thread Anette Seiler

Hi, 

I am a newbie in Perl. My boss (who isn't a newbie) has given me 
one of his programs. I am now trying to understand this program.

Right in the beginning it says:

$| = 1; # flush output after each write or print

What does it mean?

Kind regards

Anette Seiler

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




Re: $|

2002-02-15 Thread Jenda Krynicky

From:   Anette Seiler [EMAIL PROTECTED]
 I am a newbie in Perl. My boss (who isn't a newbie) has given me one
 of his programs. I am now trying to understand this program.
 
 Right in the beginning it says:
 
 $| = 1; # flush output after each write or print
 
 What does it mean?

It does exactly what the comment says. It flushes the output after 
each write or print :-)

Serious ... normaly when you write into a filehandle the data are 
not written to the disk or sent over the socket immediately. It's just 
put into a buffer and saved when the buffed is full (or under several 
other circumstances, like when you close the file or flush the 
filehandle).

While this is more efficient, sometimes you need to actualy 
save/send the data immediately ... for example because you intend 
to wait for a reply. Thus you may either flush the filehandle after 
each print or write statement or turn off the buffering for the 
filehandle. 

The $| is a bit crazy way to do it actually. IMHO it should not be 
used anymore. It turns off the buffering for currently selected 
filehandle (the one into which you print if you do not specify a 
filehandle : ' print Hello World!\n; '. By default STDOUT).

IMHO it's much cleaner and easier to understand if you use

use FileHandle;
STDOUT-autoflush();

This also prevents having to play with select() if you need to 
autoflush a non-default filehandle.

HTH, Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

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




$foo

2002-02-15 Thread Susan Aurand

I am learning Perl, so this may seem a dumb question to the advance Perl
Programmers.
What exact purpose does $foo do?
Example $foo=$_. What benefit do I get  from making the input string
$foo? Every place I look I
do not get a clear understanding or picture of $foo.
Thank you
Susan



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




RE: $foo

2002-02-15 Thread John Edwards

lol. This should help explain.

http://whatis.techtarget.com/definition/0,,sid9_gci212139,00.html

When you see something like 

$foo = $_;

It means that someone is taking the value of the default variable ($_) and
assiging in to another scalar. In this case, $foo, but it could just as
easily be $someName.

The default variable is more often than not invisible in scripts. For
example

@array = qw(one two three);

foreach (@array) {
print;
}

In that code, then default variable appears twice. Can't see it?? That's
because most of the perl operators default to working with the default
operator if no other is assigned.

The code above does exactly the same as this

@array = qw(one two three);

foreach $_ (@array) {
print $_;
}

And if you want make it clear which variable you are working with you can do
either

@array = qw(one two three);

foreach $someName (@array) {
print $somName;
}

which assigns each element in turn to $someName or...

@array = qw(one two three);

foreach (@array) {
$someName = $_;
print $someName;
}

which assigns each element in turn to $_, then you are taking that value and
assiging it to $someName within the loop and working with that new value.

HTH

John

-Original Message-
From: Susan Aurand [mailto:[EMAIL PROTECTED]]
Sent: 15 February 2002 14:49
To: [EMAIL PROTECTED]
Subject: $foo


I am learning Perl, so this may seem a dumb question to the advance Perl
Programmers.
What exact purpose does $foo do?
Example $foo=$_. What benefit do I get  from making the input string
$foo? Every place I look I
do not get a clear understanding or picture of $foo.
Thank you
Susan



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


--Confidentiality--.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



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




Re: $|

2002-02-15 Thread William.Ampeh


Straight from the Perl Cook book.

7.12. Flushing Output  (page 248)

when printing to a filehandle, output doesn't appear immediately.  This is
a problem
is CGI scripts running on some programmer-hostile web server, where, if the
web
server sees warning from Perl before it sees the buffered output on your
script, it sends
the browser an uninformative 500 server Error.

-

$| = 1  #disables buffering  (that is print when I ask you to)


__

William Ampeh (x3939)
Federal Reserve Board


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




Re: $foo

2002-02-15 Thread Jenda Krynicky

From:   Susan Aurand [EMAIL PROTECTED]

 I am learning Perl, so this may seem a dumb question to the advance
 Perl Programmers. What exact purpose does $foo do? Example $foo=$_.
 What benefit do I get  from making the input string $foo? Every place
 I look I do not get a clear understanding or picture of $foo. Thank
 you Susan

I think it's good to think about $_ as if it was a pronoun You.

s/hello/hi/g;   === Hey you there change all hellos to his!
chomp;  === Hey you drop the end-fo-line!
...

Now it you only work with one variable and the part of code is short 
it's OK to use $_ ... since you'll know which you do you mean. 
But as soon as the code gets more complex, you pass the variable 
around or you have some internal loops with their own you ... 
you'll soon loose track who are you shouting at at the moment.

Then it's good to name the variable at last. So that you know when 
do you speak to Mary and when to Robin :-)

Jenda

P.S.: If the question was more about why the heck do they use 
foo, what does that name mean. ... then .. the name foo doesn't 
mean anything. Foo is used in place of a real name of variable in 
examples and similar places. Basicaly it's also kind of ... pronoun.

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

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




Getting the proper info from an INI file...

2002-02-15 Thread Chris

I found some code, on the net, on access an INI file...

I have modified it to try and assign certain values out.

Here is the code:


my ($iniFile, $UserID, $Tester, $DNS1, $DNS2, $pwd);

$iniFile = 'c:\\test.txt';

readini;

print Tester  : $Tester\n;
print UserID  : $UserID\n;
print Password: $pwd\n;
print DNS : $DNS1\n;
print   $DNS2\n;

sub readini {
 my ($line, $section, $key, $value, @sections);
open (INI, $iniFile) || die could not open $iniFile - $! ;
while ($line = INI) {

if (($line =~ /^\;/)||($line =~ /^\s+$/)) {
 #print Comment or Whitespace\n ;
 } else {
if ($line =~ /^\[(.+)\]/) {
#print Section Header\n ;
$section = $1 ;
print 
*\n;
 print *\n;
 print *  $section \n;
 print *\n;
 print 
*\n;
push (@sections, $section) ;
 } else {
chomp $line;
($key,$value) = split(/=/, $line);
@section{$key} = $value;
if ($key == 'tester') {
 $Tester = $value;
print * $key\n;
print *1 tester $value\n;
 } elsif ($key == 'UserID') {
 $UserID = $value;
print * $key\n;
print *2 $UserID value\n;
 } elsif ($key == 'pwd') {
 $pwd = $value;
print * $key\n;
print *3 $pwd value\n;
 } elsif ($key == 'DNS1') {
 $DNS1 = $value;
print * $key\n;
print *4 $DNS1 value\n;
 } elsif ($key == 'DNS2') {
 $DNS2 = $value;
print * $key\n;
print *5 $DNS2 value\n;
 }
 }
 }
 }
 close (INI) ;

   print *\n;
print 
*\n\n;
}



(Note: Comments were removed to shorten it...)
It works, almost...

The INI file is :

[User Info]
tester=John Doe
UserID=Test123
pwd=123test
DNS1=123.60.115.177
DNS2=123.60.115.152
[Hostnames]
IP=1.2.3.4
IP=4.3.2.1
IP=128.32.154.233


But I cannot get it to get past the first value...

I have tried to make sure that the =='s and ='s are proper...

Can someone help with this??

Here is the output I get, no mater what I try..

*
*
*  User Info
*
*
* tester
*1 tester John Doe
* UserID
*1 tester Test123
* pwd
*1 tester 123test
* DNS1
*1 tester 123.60.115.177
* DNS2
*1 tester 123.60.115.152
*
*
*  Hostnames
*
*
* IP
*1 tester 1.2.3.4
* IP
*1 tester 4.3.2.1
* IP
*1 tester 128.32.154.233
*
*

Tester  : 128.32.154.233
UserID  :
Password:
DNS :

TIA!

Chris


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




Re: Urgent - Getting the left most 3 characters from a string...

2002-02-15 Thread Chris

Andrea Holstein wrote:
 In article [EMAIL PROTECTED] wrote Chris [EMAIL PROTECTED]:
 
 
...

Thanks!

...
 my $newresult = $result;
 print New Results - $$newresult\n;
 my $resultcode;
 print Result Code - $$resultcode;\n;
 if ($newresult = 200) {

 
 Take Care: You surely meant
 if ($newresult == 200) { ... }
 
 (if ($newresult = 200) means
   assign 200 to $newresult,
   and go into the if-statement if another value than 0
   was assigned, what is the fact
 )
 
 $resultcode = Code 200 - '\n;
 } elsif ($newresult = 400) {
 $resultcode = Code 400 - Bad Request\n;
 } elsif ($newresult = 403) {
 $resultcode = Code 403 - Forbidden\n;
 } elsif ($newresult = 404) {
 $resultcode = Code 404 - Not Found\n;
 } elsif ($newresult = 405) {
 $resultcode = Code 405 - Method Not Allowed\n;
 } elsif ($newresult = 406) {
 $resultcode = Code 406 - Not Acceptable\n;
 } elsif ($newresult = 407) {
 $resultcode = Code 407 - Proxy Authentication Required\n;
 } elsif ($newresult = 408) {
 $resultcode = Code 408 - Request Timeout\n;
 } elsif ($newresult = 409) {
 $resultcode = Code 409 - Conflict\n;
 } elsif ($newresult = 410) {
 $resultcode = Code 410 - Gone\n;
 } elsif ($newresult = 500) {
 $resultcode = Code 500 - Internal Server Error\n;
 } elsif ($newresult = 501) {
 $resultcode = Code 501 - Not Implemented\n;
 } elsif ($newresult = 502) {
 $resultcode = Code 502 - Bad Gateway\n;
 } elsif ($newresult = 503) {
 $resultcode = Code 503 - Service Unavailable\n;
 } elsif ($newresult = 504) {
 $resultcode = Code 504 - Gateway Timeout\n;
 } elsif ($newresult = 505) {
 $resultcode = Code 505 - HTTP Version Not Supported\n;
 } else {
 $resultcode = Unknown error...\n;
 }
 print \nNew Results Code - $resultcode\nNew Results -
$newresult\nOld Results - $result;
 print DUMPFILE * $result\n;
 print DUMPFILE *\n;
 close (DUMPFILE);


 
 I couldn't believe you really typed it in.
 Every second line is reduntant (it must be VB-style:-))
 
 However, I'd suggest a solution with a hash:
 my %code_desc = (
 200 = 'Access successful',
 400 = 'Bad Request',
 403 = 'Forbidden',
 ...
 );
 
 Then your code becomes much shorter:
 $resultcode = $code_desc{$newresult} 
 ? Code $newresult - $code_desc{$newresult}\n
 : Unknown Error;
 
 ---
 
 Of course, if you are so lazy like me,
 you can reduce the effort to define the hash, too:
 
 my %code_desc = map {/(\d+) (.*)/; ($1 = $2}} spit /\n/, DESCRIPTION;
 200 Access successful
 400 Bad Request
 403 Forbidden
 ..
 DESCRIPTION
 
 
 Best Wishes,
 Andrea
 
 

Yes it IS a VBism! :)

I am still learning Perl.  Will save your comments off, for
once I have a better understanding of what it is they are doing,
and so that I can then take full advantage of them!!!

Thanks... :) :) :)


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




Re: Help me out

2002-02-15 Thread Susan Aurand

I took your advice and added the following code to my source code. I want to print
the students name to the result
file regardless if I add a number on the end of the student name  or not. I have
tried putting the PRINT O
at different location in this code. I can not get it to print to the result file.
WHY and HELP!!
Thank You
Susan

 open(I,'STNAMES.DAT') or die$!; # open student consolidated names
 open(O,'results') or dieresults: $!\n;  # result file open output

 $c=1;

 $foo=substr($_,0,26);# strip out only the student last name and first name.

 while(exists($student{$foo})){ # if the students is used already
$foo= $_$c; # add the numer to it
$_=$foo,substr($_,27,20); # add the remainder of the file back on to input
string
$c++; # increment the number }








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




printing \n automagically?

2002-02-15 Thread Dennis G. Wicks

Greetings;

Is there any easy way to get print to do a \n without
coding it explicitly?

Most of the code fragments posted don't have any line feeds
in the print statements and without them the output gets all
strung together, overlaid with the prompt, interspersed with
messages from the mail server and other uncontrollable
things that make it far from useful. Of course the only
solution is to edit the code and hope I don't fat-finger
some errors into it!

Many TIA,
Dennis


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




RE: printing \n automagically?

2002-02-15 Thread Nikola Janceski

local $\ = \n;

man perlvars

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 11:26 AM
To: [EMAIL PROTECTED]
Subject: printing \n automagically?


Greetings;

Is there any easy way to get print to do a \n without
coding it explicitly?

Most of the code fragments posted don't have any line feeds
in the print statements and without them the output gets all
strung together, overlaid with the prompt, interspersed with
messages from the mail server and other uncontrollable
things that make it far from useful. Of course the only
solution is to edit the code and hope I don't fat-finger
some errors into it!

Many TIA,
Dennis


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




Mail::Sender on WinNT - can't connect

2002-02-15 Thread murphy, daniel (BMC Eng)

I've been wanting to send mail from some of my scripts, so I thought I'd see
how to get it to work. 

I chose to use Mail::Sender and am running Perl 5.005_03 from ActiveState
build 522 (I know, it's old) on WinNT. When I run this simple test script:

use Mail::Sender;

ref ($sender = new Mail::Sender
{smtp = 'srmontana',
from = '[EMAIL PROTECTED]'})
or die $Mail::Sender::Error\n;

ref ($sender-MailMsg({to = '[EMAIL PROTECTED]',
subject = 'Here is the file',
msg = I'm sending you the list you wanted.})),
or die $Mail::Sender::Error\n;

--

I get,

connect() failed: Unknown error



I'm not sure that this is a Perl question as much as it's a WinNT Exchange
Server, corporate environment and configuration question. This is a large
company and I use an Outlook email client. Looking at the Tools:Services
panel of Outlook, I got 'srmontana' as the name of the Exchange server. I
have also tried various combinations of these lines:

client = 'MURPHY5344A',
from = 'murphy, daniel (BMC Eng)'

 but, to no avail - I still get the connect() error.

I know the name 'srmontana' is being resolved correctly because I printed
out the smtpaddr and got the correct IP address.


Do things look right?
Is there some type of authentication, (userid, password, etc.) that's taking
place? There must be, right?

TIA,

Dan Murphy



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




RE: Mail::Sender on WinNT - can't connect

2002-02-15 Thread Nikola Janceski

shouldn't your smtp parameter have the full hostname?
You should also check that your server is accepting smtp connections from
the user and machine your are running this script on.

-Original Message-
From: murphy, daniel (BMC Eng) [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 9:51 AM
To: '[EMAIL PROTECTED]'
Subject: Mail::Sender on WinNT - can't connect


I've been wanting to send mail from some of my scripts, so I thought I'd see
how to get it to work. 

I chose to use Mail::Sender and am running Perl 5.005_03 from ActiveState
build 522 (I know, it's old) on WinNT. When I run this simple test script:

use Mail::Sender;

ref ($sender = new Mail::Sender
{smtp = 'srmontana',
from = '[EMAIL PROTECTED]'})
or die $Mail::Sender::Error\n;

ref ($sender-MailMsg({to = '[EMAIL PROTECTED]',
subject = 'Here is the file',
msg = I'm sending you the list you wanted.})),
or die $Mail::Sender::Error\n;

--

I get,

connect() failed: Unknown error



I'm not sure that this is a Perl question as much as it's a WinNT Exchange
Server, corporate environment and configuration question. This is a large
company and I use an Outlook email client. Looking at the Tools:Services
panel of Outlook, I got 'srmontana' as the name of the Exchange server. I
have also tried various combinations of these lines:

client = 'MURPHY5344A',
from = 'murphy, daniel (BMC Eng)'

. but, to no avail - I still get the connect() error.

I know the name 'srmontana' is being resolved correctly because I printed
out the smtpaddr and got the correct IP address.


Do things look right?
Is there some type of authentication, (userid, password, etc.) that's taking
place? There must be, right?

TIA,

Dan Murphy



-- 
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: Help me out

2002-02-15 Thread John Edwards

open(IN,'STNAMES.DAT') or die Can't open STNAMES.DAT: $!; # open student
consolidated names
open(OUT,'results') or die Can't create results: $!\n; # result file open
output

$counter = 1; # Use a better variable name than c. What does c stand for??
I'm assuming counter

foreach (IN) { # Now READ the contents of the IN filehandle, one line at a
time
# This next line looks like it could trip you up. Maybe a regex
would be better. Can you provide some sample lines from the input file??
$foo=substr($_,0,26);# strip out only the student last name and
first name.

# Next, you are not performing a loop here, but are using the while
operator. You would be better just checking for existence of the value.

if (exists($student{$foo}) {

# while(exists($student{$foo})){ # if the students is used already

$foo= $_$counter; # add the numer to it

# What are you trying to achieve here??
$_=$foo,substr($_,27,20); # add the remainder of the file back on to
input
string
$c++; # increment the number }


Sorry for jumping in halfway through this thread. Could you post *all* the
code you have so far, a sample of the input data and detail exactly what you
are trying to do? Maybe then we can help some more. Thanks

John

-Original Message-
From: Susan Aurand [mailto:[EMAIL PROTECTED]]
Sent: 15 February 2002 15:14
To: [EMAIL PROTECTED]
Subject: Re: Help me out


I took your advice and added the following code to my source code. I want to
print
the students name to the result
file regardless if I add a number on the end of the student name  or not. I
have
tried putting the PRINT O
at different location in this code. I can not get it to print to the result
file.
WHY and HELP!!
Thank You
Susan

 open(I,'STNAMES.DAT') or die$!; # open student consolidated names
 open(O,'results') or dieresults: $!\n;  # result file open output

 $c=1;

 $foo=substr($_,0,26);# strip out only the student last name and first
name.

 while(exists($student{$foo})){ # if the students is used already
$foo= $_$c; # add the numer to it
$_=$foo,substr($_,27,20); # add the remainder of the file back on to
input
string
$c++; # increment the number }








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


--Confidentiality--.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



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




Win32::RasAdmin

2002-02-15 Thread Veeraraju_Mareddi

Dear Team,

I am trying to install Win32::RasAdmin.but I am getting some errors.Is there
any way of Source where there are not errors.

While installing Form Activestate.com ,Roth.net,PPD format is not working.

Could anybody of you can tell where is the Correct Source to Install.

The Matter is urgent.

Thank you Very much..

With Best Regards
Rajuveera
** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**

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




RE: printing \n automagically?

2002-02-15 Thread Dennis G. Wicks

Thanks! That works great!

But!!!:

[root@iodine root]# man perlvars
No manual entry for perlvars
[root@iodine root]# perldoc perlvars
No documentation found for perlvars.
[root@iodine root]#

???,
Dennis

}On Feb 15,  9:33, Nikola Janceski wrote:
} Subject: RE: printing \n automagically?

local $\ = \n;

man perlvars


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




Latest build of Perl

2002-02-15 Thread Ned Cunningham

I have Build 628 of PERL for NT.

Is this the latest and greatest??

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




@INC

2002-02-15 Thread Pam Derks

Am trying to find out what modules have been installed on my system. I know they're 
stored in the @INC array, but how do I find out which ones they are?

thanks for any help,
Pam



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




RE: printing \n automagically?

2002-02-15 Thread Nikola Janceski

that was a typo...
man perlvar (no 's')
or
goto perldoc.com and search for perlvar




-Original Message-
From: Dennis G. Wicks [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 12:24 PM
To: Nikola Janceski; [EMAIL PROTECTED]
Subject: RE: printing \n automagically?


Thanks! That works great!

But!!!:

[root@iodine root]# man perlvars
No manual entry for perlvars
[root@iodine root]# perldoc perlvars
No documentation found for perlvars.
[root@iodine root]#

???,
Dennis

}On Feb 15,  9:33, Nikola Janceski wrote:
} Subject: RE: printing \n automagically?

local $\ = \n;

man perlvars


-- 
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: printing \n automagically?

2002-02-15 Thread Jon Molin

Dennis G. Wicks wrote:
 
 Thanks! That works great!
 
 But!!!:
 
 [root@iodine root]# man perlvars
 No manual entry for perlvars
 [root@iodine root]# perldoc perlvars
 No documentation found for perlvars.
 [root@iodine root]#
 

it's perldoc perlvar (without s)

look at perldoc perl and you'll see all the sections

/Jon


 ???,
 Dennis
 
 }On Feb 15,  9:33, Nikola Janceski wrote:
 } Subject: RE: printing \n automagically?
 
 local $\ = \n;
 
 man perlvars
 
 
 --
 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: windows paths

2002-02-15 Thread Bob Showalter

 -Original Message-
 From: Stuart Clark [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 14, 2002 10:23 PM
 To: perllist
 Subject: windows paths
 
 
 Hi all,
 
 I am putting together a script on windows.
 
 It uses filehandles.
 
 The problem is that for some reason it dosen't like the path 
 and won't create the folders and/or file.
 
 Regards
 Stuart Clark
 
 
 
 
 $OutFile = c:\\invoices\\current\\sales;
 
 open (OUTSALES,$OutFile) || die could not create $OutFile;
 
 ##Blah Blah rest of script##
 
 
 
 
 The error is : could not create c:\invoices\current\sales

The directory c:\invoices\current must exist. open() does not
create directories. You need to use mkdir() (or mkpath() from
the File::Path module) to create directories.

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




RE: printing \n automagically?

2002-02-15 Thread Brett W. McCoy

On Fri, 15 Feb 2002, Dennis G. Wicks wrote:

 Thanks! That works great!

 But!!!:

   [root@iodine root]# man perlvars
   No manual entry for perlvars
   [root@iodine root]# perldoc perlvars
   No documentation found for perlvars.
   [root@iodine root]#

Should be perldoc perlvar

-- Brett
  http://www.chapelperilous.net/

Murphy's Law is recursive.  Washing your car to make it rain doesn't work.


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




Re: Getting the proper info from an INI file...

2002-02-15 Thread Jenda Krynicky

From:   Chris [EMAIL PROTECTED]
 I found some code, on the net, on access an INI file...

There are about 10 different modules for INI files on CPAN.
I bet they'll be better than some code you found on the net and 
they'll be supported.

Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

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




Re: Mail::Sender on WinNT - can't connect

2002-02-15 Thread Jenda Krynicky

From:   murphy, daniel (BMC Eng) [EMAIL PROTECTED]

 I've been wanting to send mail from some of my scripts, so I thought
 I'd see how to get it to work. 
 
 I chose to use Mail::Sender and am running Perl 5.005_03 from
 ActiveState build 522 (I know, it's old) on WinNT. When I run this
 simple test script:
 
 use Mail::Sender;
 
 ref ($sender = new Mail::Sender
 {smtp = 'srmontana',
 from = '[EMAIL PROTECTED]'})
 or die $Mail::Sender::Error\n;
 
 --
 
 I get,
 
 connect() failed: Unknown error

Does that server accept SMTP ?

If you try
telnet srmontana 25
do you connect and get a reply something like:
220 srmontana.emc.com MS Exchange ESMTP server ready.

If not you'll have to find another server to relay the mail for you.

 Do things look right?

Yes.

 Is there some type of authentication, (userid, password, etc.) that's
 taking place? There must be, right?

If the server requires authentication then you cannot use 
Mail::Sender. Except if it requires POP3 before SMTP or 
whatever is it called ... in that case you'd have to connect and log 
into the server using Mail::POP3Client or Net::POP3 and then 
connect with Mail::Sender.

Maybe you could try either Win32::MAPI or use Win32::OLE to 
control Outlook.

Jenda


=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

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




Re: Getting the proper info from an INI file...

2002-02-15 Thread Chris

Jenda Krynicky wrote:
 From: Chris [EMAIL PROTECTED]
 
I found some code, on the net, on access an INI file...

 
 There are about 10 different modules for INI files on CPAN.
 I bet they'll be better than some code you found on the net and 
 they'll be supported.
 
 Jenda
 
 === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
 There is a reason for living. There must be. I've seen it somewhere.
 It's just that in the mess on my table ... and in my brain.
 I can't find it.
   --- me
 

Unfortunatly, any time I ty to PPM anything from CPAN, I get an
error... :(

So,.

I am on Win32 using:
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 631 provided by ActiveState Tool Corp. 
http://www.ActiveState.com
Built 17:16:22 Jan  2 2002


Not sure why I get errors trying to pull form CPAN.

Someone told me to DL their latest ZIP file, and I have YET
to find it, or know where/what to do with it :\

Also, WHat would I be looking for, on CPAN?

TIA!

Chris


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




convert ctime to a string

2002-02-15 Thread Dermot Paikkos

Hi Gurus,

SYS stuff: perl 5.005 on TRU64 UNIX or
  activeperl 5.6 on Win32.

I am getting a file listing and want to get the ctime (create time) for 
each file. My understanding is that ctime is stored in stat[10] but this 
is returning a interger such as 91070454. I was hoping it would come 
back with a date string that was human readable.

Does anyone know how to either get the ctime as a string or convert 
the interger into a date that is meaning full??

Thanx.
Dp.


~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668


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




Re: Win32::RasAdmin

2002-02-15 Thread Rick Coloccia

What version of perl are you using?

Type perl -v at the c prompt and see.

If you get this:

This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 631 provided by ActiveState Tool Corp. http://www.ActiveState.com
Built 17:16:22 Jan  2 2002


Then you can install rasadmin using ppm from:

http://www.open.com.au/radiator/free-downloads/Win32-RasAdmin.ppd


-Rick



At 08:41 PM 2/15/2002, Veeraraju_Mareddi wrote:
Dear Team,

I am trying to install Win32::RasAdmin.but I am getting some errors.Is there
any way of Source where there are not errors.

While installing Form Activestate.com ,Roth.net,PPD format is not working.

Could anybody of you can tell where is the Correct Source to Install.

The Matter is urgent.

Thank you Very much..

With Best Regards
Rajuveera
**
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**
___
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


-
Rick Coloccia
Network Analyst
SUNY Geneseo
124B2 South Hall
Geneseo, NY 14454
Voice: (585) 245-5577
Fax: (585) 245-5579


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




Re: @INC

2002-02-15 Thread walter valenti

You can find in the directory of @INC

For example a module  XX::pippo you must find  @INC/XX/pippo.pm


Walter

Am trying to find out what modules have been installed on my system. I know they're 
stored in the @INC array, but how do I find out which ones they are?

thanks for any help,
Pam







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




RE: Mail::Sender on WinNT - can't connect

2002-02-15 Thread Mark Richmond


As Jenda mentioned your exchange server might not support SMTP. You may
also run into mail relay problems with exchange if you don't
authenticate with a DOMAIN. Also it's very likely that exchange is not
configured to relay outside the company. For simple mail messages I use
Mail::Sendmail 


# Exchange relays this fine INSIDE the company which is all I need 

use Mail::Sendmail;
$mail{Smtp}   = 'mailserver'; # override sendmail.pm 
my $domain=  'yourdomain.com' 
my $user  = 'your name' 

$mail{From}   = $user\@$domain ; 
$mail{To} = $user\@$domain ; 
$mail{Subject} = Test Mail ;

$mail{Message} = foo;
$mail{Message} .= bar \n;

sendmail %mail ; 
if ($Mail::Sendmail::error) {
print content of
\$Mail::Sendmail::error:\n$Mail::Sendmail::error\n;
}
exit 0;


 -Original Message-
 From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 15, 2002 10:57 AM
 To: '[EMAIL PROTECTED]'
 Subject: Re: Mail::Sender on WinNT - can't connect
 
 
 From: murphy, daniel (BMC Eng) 
 [EMAIL PROTECTED]
 
  I've been wanting to send mail from some of my scripts, so I thought
  I'd see how to get it to work. 
  
  I chose to use Mail::Sender and am running Perl 5.005_03 from
  ActiveState build 522 (I know, it's old) on WinNT. When I run this
  simple test script:
  
  use Mail::Sender;
  
  ref ($sender = new Mail::Sender
  {smtp = 'srmontana',
  from = '[EMAIL PROTECTED]'})
  or die $Mail::Sender::Error\n;
  
  --
  
  I get,
  
  connect() failed: Unknown error
 
 Does that server accept SMTP ?
 
 If you try
   telnet srmontana 25
 do you connect and get a reply something like:
   220 srmontana.emc.com MS Exchange ESMTP server ready.
 
 If not you'll have to find another server to relay the mail for you.
 
  Do things look right?
 
 Yes.
 
  Is there some type of authentication, (userid, password, 
 etc.) that's
  taking place? There must be, right?
 
 If the server requires authentication then you cannot use 
 Mail::Sender. Except if it requires POP3 before SMTP or 
 whatever is it called ... in that case you'd have to connect and log 
 into the server using Mail::POP3Client or Net::POP3 and then 
 connect with Mail::Sender.
 
 Maybe you could try either Win32::MAPI or use Win32::OLE to 
 control Outlook.
 
 Jenda
 
 
 === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
 There is a reason for living. There must be. I've seen it somewhere.
 It's just that in the mess on my table ... and in my brain.
 I can't find it.
   --- me
 
 -- 
 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: convert ctime to a string

2002-02-15 Thread Brett W. McCoy

On Fri, 15 Feb 2002, Dermot Paikkos wrote:

 Does anyone know how to either get the ctime as a string or convert
 the interger into a date that is meaning full??

Sure:

  my @stats = stat($file);

  print Create Time: , scalar(localtime($stats[10])), \n;

See perldoc -f localtime

-- Brett
  http://www.chapelperilous.net/

He thinks by infection, catching an opinion like a cold.


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




Re: convert ctime to a string

2002-02-15 Thread walter valenti

use Time::localtime;

sub tempo{
my $tm=localtime();
my $h=$tm-hour;
my $m=$tm-min;
my $s=$tm-sec;
my $md=$tm-mday; ##giorno
my $me=$tm-mon+1;  ##mese
my $y=$tm-year+1900;
return $h:$m:$s [$md/$me/$y] ;
}



Walter

Hi Gurus,

   SYS stuff: perl 5.005 on TRU64 UNIX or
 activeperl 5.6 on Win32.

I am getting a file listing and want to get the ctime (create time) for 
each file. My understanding is that ctime is stored in stat[10] but this 
is returning a interger such as 91070454. I was hoping it would come 
back with a date string that was human readable.

Does anyone know how to either get the ctime as a string or convert 
the interger into a date that is meaning full??

Thanx.
Dp.


~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668






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




Re: convert ctime to a string

2002-02-15 Thread Brett W. McCoy

On Fri, 15 Feb 2002, Brett W. McCoy wrote:

  Does anyone know how to either get the ctime as a string or convert
  the interger into a date that is meaning full??

 Sure:

   my @stats = stat($file);

   print Create Time: , scalar(localtime($stats[10])), \n;

I'm sorry, that's not the create time, but the inode change time.

-- Brett
  http://www.chapelperilous.net/

Once, adv.:
Enough.
-- Ambrose Bierce, The Devil's Dictionary


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




Error from a `cmd` sent to a subroutine?

2002-02-15 Thread Paul Farley

Hi all, I'm trying to figure this out, I'd appreciate any help.

I have an application that I am using a perl script to do pattern matching
and then execute commands specific to that application.  I need a way to
handle an error in my script if one of the `cmd blah`; doesn't work and send
it to an error subroutine.

Here's what I have now:
SNIPPED

sub subscription
 {
($passed_ep,$passed_pr$passed_sub,$passed_org,$passed_plat)=shift;

  #add error routine to handle if PR/PM doesn't exist -pass to
exception_sub?
   `wsub \@ProfileManager:Staging \@Endpoint:$passed_ep`;
   `wln \@Endpoint:$passed_ep \@PolicyRegion:$passed_pr\.$passed_org`;
   `wsub \@ProfileManager:$passed_sub\.$passed_org\.$passed_plat\.ep
\@Endpoint:$passed_ep`;
   # on error pass ($ep,$pr,$sub,$org,$plat)
 }

sub exception_sub
  {
  ($passed_ep,$passed_pr$passed_sub,$passed_org,$passed_plat)=shift;
  `wsub \@ProfileManager:Exceptions \@Endpoint:$passed_ep`;
  print AFTERLOG $passed_ep cannot go to $passed_org - Check PR
Structure\n;
  }

I tried:

`wsub \@ProfileManager:Staging \@Endpoint:$passed_ep` ||
exception_sub($passed_ep);

but that didn't work.

-Paul Farley
[EMAIL PROTECTED]





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




Re: Error from a `cmd` sent to a subroutine?

2002-02-15 Thread Brett W. McCoy

On Fri, 15 Feb 2002, Paul Farley wrote:

 I have an application that I am using a perl script to do pattern matching
 and then execute commands specific to that application.  I need a way to
 handle an error in my script if one of the `cmd blah`; doesn't work and send
 it to an error subroutine.

 Here's what I have now:
 SNIPPED

 sub subscription
  {
 ($passed_ep,$passed_pr$passed_sub,$passed_org,$passed_plat)=shift;

   #add error routine to handle if PR/PM doesn't exist -pass to
 exception_sub?
`wsub \@ProfileManager:Staging \@Endpoint:$passed_ep`;
`wln \@Endpoint:$passed_ep \@PolicyRegion:$passed_pr\.$passed_org`;
`wsub \@ProfileManager:$passed_sub\.$passed_org\.$passed_plat\.ep
 \@Endpoint:$passed_ep`;
# on error pass ($ep,$pr,$sub,$org,$plat)
  }

You should use the system command here.  You are using `` in a void
context, and it's unnecessary to do so, unless you are doing something
with the output strings.

I would do something like:

  sub mysub {
...
system(cmd, @args) == 0
  or die Error running com: $?\n;
...
  }

  sub handle_error {
my $error_msg = shift;

print $error_msg\n;
print LOG $error_msg\n;
...
  }

And handle the errors this way:

eval {
  mysub();
};

handle_error($@) if $@;

See the perldoc on eval -- it provides a fairly easy way to throw and
catch exceptions -- die throws the exception, eval catches it, and puts
the error message from die into $@.

-- Brett
  http://www.chapelperilous.net/

Alcohol, hashish, prussic acid, strychnine are weak dilutions. The surest
poison is time.
-- Emerson, Society and Solitude


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




text file database question

2002-02-15 Thread Hughes, Andrew

I have been given the task to create a contest for which appox. 90,000
people might be signing up(collected info: name, company, email, phone,
address1, address2).  Due to various reasons, I am not able to use a true
database like mySQL to store the information.  At this point I am going to
have to use a text file, which I have used in the past, but not at this
level of possible entries (we are really going to be promoting this heavily
on and offline).  Please let me know if you think this is a possible
dangerous level of entries for a text file.

Also, in my experience with text files, I have not been able to stop people
from hitting submit a few times before the form submits (i.e. I have
multiple lines of the same entry).  How would I stop this -- still talking
about text files?

Thanks,
Andrew

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




Re: octal file permissions

2002-02-15 Thread Randal L. Schwartz

 Zentara == Zentara  [EMAIL PROTECTED] writes:

Zentara After putting on the dunce cap and typing 100 times:
Zentara the oct function takes a decimal value and returns octal,
Zentara  and  (stat file)[2] returns a decimal value I finally see it.
Zentara I think I do anyways. :-)

No, it doesn't.

The oct function interprets a number rendered as octal string, and
returns a *number*.  stat returns a *number*.  There's nothing
inherently decimal about either, and I think that's where the
confusion results.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL: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]




RE: text file database question

2002-02-15 Thread Nikola Janceski

Ouch... 90,000 is pushing it. You would have to be very careful not to dump
all that info to memory, (start learing how to use seek, tell and $. ).

As for your multiple entries, either check for multiple entries and/or use
flock on the file. If you lock the file then only one thing can go in at a
time. But like I said.. you might want to have serveral files with the same
info (a pseudodatabase) like associate a number to a username in one file
and that same number to the address in another file, etc.

Someone else might have a better idea how to handle data of that size in an
easier way.

-Original Message-
From: Hughes, Andrew [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 11:39 AM
To: '[EMAIL PROTECTED]'
Subject: text file database question


I have been given the task to create a contest for which appox. 90,000
people might be signing up(collected info: name, company, email, phone,
address1, address2).  Due to various reasons, I am not able to use a true
database like mySQL to store the information.  At this point I am going to
have to use a text file, which I have used in the past, but not at this
level of possible entries (we are really going to be promoting this heavily
on and offline).  Please let me know if you think this is a possible
dangerous level of entries for a text file.

Also, in my experience with text files, I have not been able to stop people
from hitting submit a few times before the form submits (i.e. I have
multiple lines of the same entry).  How would I stop this -- still talking
about text files?

Thanks,
Andrew

-- 
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: @INC

2002-02-15 Thread Jeff 'japhy' Pinyan

On Feb 15, Pam Derks said:

Am trying to find out what modules have been installed on my system. I
know they're stored in the @INC array, but how do I find out which ones
they are?

I've got a program that can be run from the web OR from the command-line
to list them for you.

  http://www.pobox.com/~japhy/programs/modlist

-- 
Jeff japhy Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for Regular Expressions in Perl published by Manning, in 2002 **
stu what does y/// stand for?  tenderpuss 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: convert ctime to a string

2002-02-15 Thread walter valenti

Dermot Paikkos wrote:

That has worked a treat.
2 more Qs.

1) Do we summarize solutions and send them to the mail list?

Why no ???



2) What do they call that method of getting variable for a module?


localtime is UNIX time, adapted for zone time,
sec,min,hour, methods are obvious.

day method is number of the day (1 to 31)

month imethos s the number month's from 0 (January) to 11 (December)

year method is the year menus 1900


Walter



Big thanx.
Dp.


On 15 Feb 2002 at 17:20, walter valenti wrote:

use Time::localtime;

sub tempo{
my $tm=localtime();
my $h=$tm-hour;
my $m=$tm-min;
my $s=$tm-sec;
my $md=$tm-mday; ##giorno
my $me=$tm-mon+1;  ##mese
my $y=$tm-year+1900;
return $h:$m:$s [$md/$me/$y] ;
}



Walter

Hi Gurus,

 SYS stuff: perl 5.005 on TRU64 UNIX or
   activeperl 5.6 on Win32.

I am getting a file listing and want to get the ctime (create time)
for each file. My understanding is that ctime is stored in stat[10]
but this is returning a interger such as 91070454. I was hoping it
would come back with a date string that was human readable.

Does anyone know how to either get the ctime as a string or convert
the interger into a date that is meaning full??

Thanx.
Dp.


~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668







~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668






Re: Error from a `cmd` sent to a subroutine?

2002-02-15 Thread Farley Paul J Contr 78 CS/SCBN

That worked like a champ!  Thanks!

Here's what I ended up with:

#this one should fail
system(wsub \@ProfileManager:Garbage \@Endpoint:$ep, @args)==0 or
exception($ep); 

#This one should work
system(wsub \@ProfileManager:ZZ-Paul-aft_test.pm \@Endpoint:$ep,@args)==0
or exception($ep);


sub exception
{
$passed_ep=shift;
#`wsub \@ProfileManager:Exceptions \@Endpoint:$passed_ep`;
#print AFTERLOG $passed_ep no match !!!\n;
print $passed_ep error !!!\n;
}
}

Brett W. McCoy [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Fri, 15 Feb 2002, Paul Farley wrote:
 
  I have an application that I am using a perl script to do pattern
matching
  and then execute commands specific to that application.  I need a way to
  handle an error in my script if one of the `cmd blah`; doesn't work and
send
  it to an error subroutine.
 
  Here's what I have now:
  SNIPPED
 
  sub subscription
   {
  ($passed_ep,$passed_pr$passed_sub,$passed_org,$passed_plat)=shift;
 
#add error routine to handle if PR/PM doesn't exist -pass to
  exception_sub?
 `wsub \@ProfileManager:Staging \@Endpoint:$passed_ep`;
 `wln \@Endpoint:$passed_ep \@PolicyRegion:$passed_pr\.$passed_org`;
 `wsub \@ProfileManager:$passed_sub\.$passed_org\.$passed_plat\.ep
  \@Endpoint:$passed_ep`;
 # on error pass ($ep,$pr,$sub,$org,$plat)
   }
 
 You should use the system command here.  You are using `` in a void
 context, and it's unnecessary to do so, unless you are doing something
 with the output strings.
 
 I would do something like:
 
   sub mysub {
 ...
 system(cmd, @args) == 0
   or die Error running com: $?\n;
 ...
   }
 
   sub handle_error {
 my $error_msg = shift;
 
 print $error_msg\n;
 print LOG $error_msg\n;
 ...
   }
 
 And handle the errors this way:
 
 eval {
   mysub();
 };
 
 handle_error($@) if $@;
 
 See the perldoc on eval -- it provides a fairly easy way to throw and
 catch exceptions -- die throws the exception, eval catches it, and puts
 the error message from die into $@.
 
 -- Brett
   http://www.chapelperilous.net/
 
 Alcohol, hashish, prussic acid, strychnine are weak dilutions. The surest
 poison is time.
   -- Emerson, Society and Solitude
 

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




Re: octal file permissions

2002-02-15 Thread Randal L. Schwartz

 Michael == Michael Fowler [EMAIL PROTECTED] writes:

Michael Heh, you still have that backwards.  oct() interprets its argument as an
Michael octal value, and returns its decimal equivalent.

Interesting that you use decimal here...

Michael Also, it's best not to think of functions returning numbers in a specific
Michael base.  Functions simply return numbers, its when you output them that they
Michael have to be interpreted in a certain base.

... when you correct it here.  Thank goodness. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL: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]




unsupported function

2002-02-15 Thread Lanceo

I am getting this weird error message:

The Unsupported function alarm function is unimplemented at SiteTest.pm line
42.

here is the code:

alarm 20;


I also get this error in any other module that I call that use
larm( Net::Ping for example)  Now, I always thought that the alarm function
was part of core Perl.

I am using ActiveState ActivePerl  5.3.1 build 631




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/02



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




multiple __DATA__ entries possible?

2002-02-15 Thread zentara

Is it possible to have multiple __DATA__
entries in a program.  I can seem to find
a way to end __DATA__, and @array is
getting everything.  How to I end __DATA__?


Like:

@array = DATA;
@array1 = DATA1;

__DATA__
stuff
more stuff

__DATA1__
stuff
more stuff



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




RE: convert ctime to a string

2002-02-15 Thread Bob Showalter

 -Original Message-
 From: Dermot Paikkos [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 15, 2002 11:06 AM
 To: [EMAIL PROTECTED]
 Subject: convert ctime to a string
 
 
 Hi Gurus,
 
   SYS stuff: perl 5.005 on TRU64 UNIX or
 activeperl 5.6 on Win32.
 
 I am getting a file listing and want to get the ctime (create 
 time) for 
 each file. My understanding is that ctime is stored in 
 stat[10] but this 
 is returning a interger such as 91070454. I was hoping it would come 
 back with a date string that was human readable.
 
 Does anyone know how to either get the ctime as a string or convert 
 the interger into a date that is meaning full??

ctime is inode change time, not create time. It is updated by things
like chown, chmod, link, etc., or by changes to the file size.

You probably want mtime. There is no way on UNIX to get creation time.

Once you have it, use localtime() or gmtime() to convert to separate
components or to strings. The POSIX module's strftime() function lets
you format the string in a variety of ways.

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




More string manipulation

2002-02-15 Thread Brian Johnson

I have the following code that I need a little advice on.

The $record-{month} returns the month in integer format (ie 1, 2, 3), I
need to change it to to a three letter string (ie Jan, Feb, Mar)

  foreach $item (@items) {
my $record;
my $test;
foreach $record (@{$PDB-{records}}) {
  # look for date, from, or subject
  # XXX add date/time check
  # Skip everything except the Inbox folder
  next if ($record-{category} ne $cat);
  my $emaildate = $record-{day} $record-{month} $record-{year}
$record-{hour}:$record-{minute};
  if ( $record-{subject} eq $item-{Subject} 
   $record-{from} eq $item-{From} 
   $item-{Date} =~ $emaildate) {
#do something
if( $record-{is_read} ne $item-{is_read}) {
  $record-{is_read} = $item-{is_read};
  $record-{attributes}{dirty}=1;
}
  }
}
  }


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




RE: More string manipulation

2002-02-15 Thread Timothy Johnson


You could try making an array or hash with the months(I used an array
because the index is already numeric):

   @mons =
('Nul','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','De
c');

   #convert the date
   $threeLetterMonth = $mons[$record-{month}];


-Original Message-
From: Brian Johnson [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 9:20 AM
To: [EMAIL PROTECTED]
Subject: More string manipulation


I have the following code that I need a little advice on.

The $record-{month} returns the month in integer format (ie 1, 2, 3), I
need to change it to to a three letter string (ie Jan, Feb, Mar)

  foreach $item (@items) {
my $record;
my $test;
foreach $record (@{$PDB-{records}}) {
  # look for date, from, or subject
  # XXX add date/time check
  # Skip everything except the Inbox folder
  next if ($record-{category} ne $cat);
  my $emaildate = $record-{day} $record-{month} $record-{year}
$record-{hour}:$record-{minute};
  if ( $record-{subject} eq $item-{Subject} 
   $record-{from} eq $item-{From} 
   $item-{Date} =~ $emaildate) {
#do something
if( $record-{is_read} ne $item-{is_read}) {
  $record-{is_read} = $item-{is_read};
  $record-{attributes}{dirty}=1;
}
  }
}
  }


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



This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

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




Re: octal file permissions

2002-02-15 Thread Randal L. Schwartz

 Tanton == Tanton Gibbs [EMAIL PROTECTED] writes:

Tanton To change from decimal to octal, you can use sprintf with a %o format string
Tanton my $val = sprintf( %o, 8 );
Tanton print $val;
Tanton 10

No, this changes from a *number*, which you have typically typed
in decimal, to an octal string representation.  Compare yours
with this:

my $val = sprintf %o, 010;

There.  It's converting octal to octal, using your incorrect language!

013 is a *number*, exactly the same number as 11 or 0xB or 0b1011,
using the Perl numeric literals.  None of them are decimal.

The act of rendering a number to text defaults to decimal strings,
hence your (common) confusion.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL: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]




Re: unsupported function

2002-02-15 Thread Michael Fowler

On Fri, Feb 15, 2002 at 05:02:22PM -, Lanceo wrote:
 I also get this error in any other module that I call that use
 larm( Net::Ping for example)  Now, I always thought that the alarm function
 was part of core Perl.

It is, but it requires support from the operating system to work.  Your OS
doesn't have an equivalent.  Assuming your OS is Win32, this is documented
in perldoc perlport.

 
 I am using ActiveState ActivePerl  5.3.1 build 631

Surely you mean 5.6.1, not 5.3.1.


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: multiple __DATA__ entries possible?

2002-02-15 Thread Michael Fowler

On Fri, Feb 15, 2002 at 12:06:22PM -0500, zentara wrote:
 Is it possible to have multiple __DATA__ entries in a program.

No.


 I can seem to find a way to end __DATA__, and @array is getting
 everything.  How to I end __DATA__?

__DATA__ ends at EOF.


The only alternative I can think of at the moment, short of using multiple
files, is to place a marker in the text for where @array should stop and
@array1 should begin.

For example:

#!/usr/bin/perl -w

use strict;

my(@array, @array1);
while (my $line = DATA) {
last if $line eq EOD\n;
push(@array, $line);
}

@array1 = DATA

__DATA__
stuff
more stuff
EOD
stuff
more stuff


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: More string manipulation

2002-02-15 Thread Andrea Holstein

In article 00bb01c1b645$0b8eef80$[EMAIL PROTECTED] wrote Brian Johnson
[EMAIL PROTECTED]:

 I have the following code that I need a little advice on.

It'e easier for us all, 
if you short describe your problem.
I assume that the following contains some errors,
you can't find.

 
 The $record-{month} returns the month in integer format (ie 1, 2, 3), I need to 
change it to to a
 three letter string (ie Jan, Feb, Mar)

There are sure some Date:: modules absolving this job.
Unless them a simple array will convert:

my @month_long = (undef, qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/);

now $month_long[4] contains 'Apr'.

 
   foreach $item (@items) {
 my $record;

Declare your variables, where you need them.

 my $test;

Where do you need $test;

 foreach $record (@{$PDB-{records}}) {
  ^^
  my $record

   # look for date, from, or subject
   # XXX add date/time check
   # Skip everything except the Inbox folder
   next if ($record-{category} ne $cat);
   my $emaildate = $record-{day} $record-{month} $record-{year}
 $record-{hour}:$record-{minute};
   if ( $record-{subject} eq $item-{Subject} 
$record-{from} eq $item-{From} 
$item-{Date} =~ $emaildate) {
  ^^
   looks dangerous, didn't you mean $item-{Date} eq /$emaildate/;
 #do something
 if( $record-{is_read} ne $item-{is_read}) {
   $record-{is_read} = $item-{is_read};
   $record-{attributes}{dirty}=1;
 }
   }
 }
   }

I find the code hard to read, because there are so many $record assignments.
I would shorten the code to:

my @month_long = (undef, qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/);
foreach my $item (@items) {
foreach (grep {$_-{category} eq $cat} @{$PDB-{records}}) {
my $emaildate = 
$_-{day} $month_long[$_-{month}] $_-{year} $_-{hour}:$_-{minute};
if ($_-{subject} eq $item-{Subject} 
$_-{from} eq $item-{From} 
$_-{Date} eq $emaildate) {

# do something

}
}
}

Best Wishes,
Andrea


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




Re: multiple __DATA__ entries possible?

2002-02-15 Thread Andrea Holstein

In article [EMAIL PROTECTED] wrote Zentara 
[EMAIL PROTECTED]:

 Is it possible to have multiple __DATA__
 entries in a program.  I can seem to find
 a way to end __DATA__, and @array is
 getting everything.  How to I end __DATA__?
 
 
 Like:
 
 @array = DATA;
 @array1 = DATA1;
 
 __DATA__
 stuff
 more stuff
 
 __DATA1__
 stuff
 more stuff

As I know, there is no builtin-possibility.
But it's simple to simulate.

my @data;
my $nr = 0;
while (DATA) {
/^__DATA__/ ? $nr++ : push $data[$nr], $_;
}

Now assuming this data ending:

__DATA__
content 1
__DATA__
content 2
__END__

@{$data[0]} contains the first Data,
@{$data[1]} the second, and so on.

Best Wishes,
Andrea

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




Re: printing \n automagically?

2002-02-15 Thread Andrea Holstein

In article [EMAIL PROTECTED] wrote Dennis G. Wicks [EMAIL PROTECTED]:

 Greetings;
 
 Is there any easy way to get print to do a \n without coding it explicitly?
 
 Most of the code fragments posted don't have any line feeds in the print statements 
and without
 them the output gets all strung together, overlaid with the prompt, interspersed 
with messages
 from the mail server and other uncontrollable things that make it far from useful. 
Of course the
 only solution is to edit the code and hope I don't fat-finger some errors into it!
 
 Many TIA,
 Dennis

Set the special variable $\ = \n;
$\ contains the string printed out after every print statement.
The default value of $\ is ''.

Best Wishes,
Andrea

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




RE: Mail::Sender on WinNT - can't connect

2002-02-15 Thread murphy, daniel (BMC Eng)

 
 I get,
 
 connect() failed: Unknown error


Jenda said:

Does that server accept SMTP ?

If you try
telnet srmontana 25
do you connect and get a reply something like:
220 srmontana.emc.com MS Exchange ESMTP server ready.

If not you'll have to find another server to relay the mail for you.



Aha, I tried telnet'ing to port 25 a few ways and got rejected, so
apparently this server doesn't accept SMTP, right?

So it looks like it's an internal issue rather than Perl. I'll have to ask
around to see what my options are.

Thanks,

Dan
  

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




Re: multiple __DATA__ entries possible?

2002-02-15 Thread Jeff 'japhy' Pinyan

On Feb 15, zentara said:

Is it possible to have multiple __DATA__
entries in a program.  I can seem to find
a way to end __DATA__, and @array is
getting everything.  How to I end __DATA__?

Sounds like you might want the Inline::Files module.  If you don't want
that overhead, though, you can use a homemade solution.  I'll come up with
something a little later.

-- 
Jeff japhy Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for Regular Expressions in Perl published by Manning, in 2002 **
stu what does y/// stand for?  tenderpuss 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: text file database question

2002-02-15 Thread Lanceo

Perl has access to the UNIX DBM database.  You might want to try that if you
are using a UNIX variant.

Andrew Hughes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have been given the task to create a contest for which appox. 90,000
 people might be signing up(collected info: name, company, email, phone,
 address1, address2).  Due to various reasons, I am not able to use a true
 database like mySQL to store the information.  At this point I am going to
 have to use a text file, which I have used in the past, but not at this
 level of possible entries (we are really going to be promoting this
heavily
 on and offline).  Please let me know if you think this is a possible
 dangerous level of entries for a text file.

 Also, in my experience with text files, I have not been able to stop
people
 from hitting submit a few times before the form submits (i.e. I have
 multiple lines of the same entry).  How would I stop this -- still talking
 about text files?

 Thanks,
 Andrew


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/02



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




Re: Latest build of Perl

2002-02-15 Thread Lanceo

ActivePerl 631
Ned Cunningham [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have Build 628 of PERL for NT.

 Is this the latest and greatest??


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/02



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




Re: Getting the proper info from an INI file...

2002-02-15 Thread Chris

Chris wrote:
 Jenda Krynicky wrote:
 
 From:   Chris [EMAIL PROTECTED]

 I found some code, on the net, on access an INI file...


 There are about 10 different modules for INI files on CPAN.
 I bet they'll be better than some code you found on the net and 
 they'll be supported.

 Jenda

 === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
 There is a reason for living. There must be. I've seen it somewhere.
 It's just that in the mess on my table ... and in my brain.
 I can't find it.
 --- me

 
 Unfortunatly, any time I ty to PPM anything from CPAN, I get an
 error... :(
 
 So,.
 
 I am on Win32 using:
 This is perl, v5.6.1 built for MSWin32-x86-multi-thread
 (with 1 registered patch, see perl -V for more detail)
 
 Copyright 1987-2001, Larry Wall
 
 Binary build 631 provided by ActiveState Tool Corp. 
 http://www.ActiveState.com
 Built 17:16:22 Jan  2 2002
 
 
 Not sure why I get errors trying to pull form CPAN.
 
 Someone told me to DL their latest ZIP file, and I have YET
 to find it, or know where/what to do with it :\
 
 Also, WHat would I be looking for, on CPAN?
 
 TIA!
 
 Chris
 
Yes,  folks..

I am still awaiting to hear an answer...

My original post had all the code to the .pl,
and the output to show how it is failing.  Let me know if
I need to repost the code.

TIA!




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




Checking Perl load

2002-02-15 Thread Ned Cunningham

I would be looking for a way to test if perl is loaded on a NT machine.
Does anyone have a quick answer or command line to do this?



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




Re: Getting the proper info from an INI file...

2002-02-15 Thread Chris

Chris wrote:
 Jenda Krynicky wrote:
 
 From:   Chris [EMAIL PROTECTED]

 I found some code, on the net, on access an INI file...


 There are about 10 different modules for INI files on CPAN.
 I bet they'll be better than some code you found on the net and 
 they'll be supported.

 Jenda

 === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
 There is a reason for living. There must be. I've seen it somewhere.
 It's just that in the mess on my table ... and in my brain.
 I can't find it.
 --- me

 
 Unfortunatly, any time I ty to PPM anything from CPAN, I get an
 error... :(
 
 So,.
 
 I am on Win32 using:
 This is perl, v5.6.1 built for MSWin32-x86-multi-thread
 (with 1 registered patch, see perl -V for more detail)
 
 Copyright 1987-2001, Larry Wall
 
 Binary build 631 provided by ActiveState Tool Corp. 
 http://www.ActiveState.com
 Built 17:16:22 Jan  2 2002
 
 
 Not sure why I get errors trying to pull form CPAN.
 
 Someone told me to DL their latest ZIP file, and I have YET
 to find it, or know where/what to do with it :\
 
 Also, WHat would I be looking for, on CPAN?
 
 TIA!
 
 Chris
 
Yes,  folks..

I am still awaiting to hear an answer...

My original post had all the code to the .pl,
and the output to show how it is failing.  Let me know if
I need to repost the code.

TIA!




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




RE: Differences in DBM

2002-02-15 Thread Hanson, Robert

There is some info on the AnyDBM_File manpage.

http://www.perldoc.com/perl5.6.1/lib/AnyDBM_File.html

Rob

-Original Message-
From: Balint, Jess [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:05 PM
To: '[EMAIL PROTECTED]'
Subject: Differences in DBM


Hello, I was wondering what were the differences in different DMB modules,
specifically, SDBM, NDBM, ODBM, MLDBM, AnyDBM, and DB? Thanks.

-- 
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: Checking Perl load

2002-02-15 Thread Hanson, Robert

You can check to see if its in your path by typing perl -v at the command
line, otherwise  just use the search finction, and search for perl.exe.

Rob


-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:19 PM
To: '[EMAIL PROTECTED]'
Subject: Checking Perl load


I would be looking for a way to test if perl is loaded on a NT machine.
Does anyone have a quick answer or command line to do this?

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




RE: Checking Perl load

2002-02-15 Thread Timothy Johnson


You could try checking the $ENV{'PATH'} variable:

if($ENV{'PATH'} =~ /perl\\bin/i){
   print Perl found!\n;
}else{
   print Perl not found!\n;
}

-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 11:19 AM
To: [EMAIL PROTECTED]
Subject: Checking Perl load


I would be looking for a way to test if perl is loaded on a NT machine.
Does anyone have a quick answer or command line to do this?



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



This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

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




RE: Checking Perl load

2002-02-15 Thread Ned Cunningham

Yes, except I load the path separately, so it is on the systems.
I would need to check it in a bat file remotely.

-Original Message-
From:   Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent:   Friday, February 15, 2002 2:23 PM
To: 'Ned Cunningham'; '[EMAIL PROTECTED]'
Subject:RE: Checking Perl load

You can check to see if its in your path by typing perl -v
at the command
line, otherwise  just use the search finction, and search
for perl.exe.

Rob


-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:19 PM
To: '[EMAIL PROTECTED]'
Subject: Checking Perl load


I would be looking for a way to test if perl is loaded on a
NT machine.
Does anyone have a quick answer or command line to do this?

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




RE: Getting the proper info from an INI file...

2002-02-15 Thread Hanson, Robert

My preference is Config::IniFiles.  You can see others by searching on CPAN.

http://search.cpan.org/doc/WADG/Config-IniFiles-2.27/IniFiles.pm

You also can't load files from CPAN using PPM.  PPM loads from the
ActiveState repositiory only!  If you want to use CPAN modules you need to
find nmake.exe, it comes with C++ or can bo downloaded from
ftp.microsoft.com... I forget where it lives though.  For some modules (ones
with C code) you will also need C++ installed, but even then you may have
some problems.

To search in PPM go into the tool and type search ini.  A few other
options will show up.

Rob


-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:16 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Getting the proper info from an INI file...

 
 Unfortunatly, any time I ty to PPM anything from CPAN, I get an
 error... :(
 
 So,.
 
 I am on Win32 using:
 This is perl, v5.6.1 built for MSWin32-x86-multi-thread
 (with 1 registered patch, see perl -V for more detail)
 
 Copyright 1987-2001, Larry Wall
 
 Binary build 631 provided by ActiveState Tool Corp. 
 http://www.ActiveState.com
 Built 17:16:22 Jan  2 2002
 
 
 Not sure why I get errors trying to pull form CPAN.
 
 Someone told me to DL their latest ZIP file, and I have YET
 to find it, or know where/what to do with it :\
 
 Also, WHat would I be looking for, on CPAN?
 
 TIA!
 
 Chris
 
Yes,  folks..

I am still awaiting to hear an answer...

My original post had all the code to the .pl,
and the output to show how it is failing.  Let me know if
I need to repost the code.

TIA!

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




RE: Checking Perl load

2002-02-15 Thread Hanson, Robert

Then how about dir /s perl.exe?

Rob

-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:25 PM
To: Hanson, Robert; Ned Cunningham; '[EMAIL PROTECTED]'
Subject: RE: Checking Perl load


Yes, except I load the path separately, so it is on the systems.
I would need to check it in a bat file remotely.

-Original Message-
From:   Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent:   Friday, February 15, 2002 2:23 PM
To: 'Ned Cunningham'; '[EMAIL PROTECTED]'
Subject:RE: Checking Perl load

You can check to see if its in your path by typing perl -v
at the command
line, otherwise  just use the search finction, and search
for perl.exe.

Rob


-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:19 PM
To: '[EMAIL PROTECTED]'
Subject: Checking Perl load


I would be looking for a way to test if perl is loaded on a
NT machine.
Does anyone have a quick answer or command line to do this?

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




RE: Caching Large Data Structures To Disk

2002-02-15 Thread Balint, Jess

Would it be possible to use 'tie' to operate on a large complex data
structure from disk?

-Original Message-

Well, I think some file systems can't handle file bigger than two gig,
but I think that is the only limitation (I could be wrong, I don't use
dbm for much).

On Thu, 2002-02-14 at 16:35, Balint, Jess wrote:
 Is there a dbm file size limit that I have to worry about?
 
 -Original Message-
 From: Chas Owens [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 14, 2002 4:30 PM
 To: Balint, Jess
 Subject: RE: Caching Large Data Structures To Disk
 
 
 You will have to first use eval to revive the string.  Take a look at
 perldoc Data::Dumper.
 
 
 On Thu, 2002-02-14 at 16:06, Balint, Jess wrote:
  If I store strings from data dumper, can I still pull stuff off like
  retrieving values from an anonymous array stored in the hash while
having
  the data stored on the disk? Or do I need to put the array in memory
 first?
  I guess the underlying question is does perl operate on data structures
as
  plain text?
  
  -Original Message-
  From: Chas Owens [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, February 14, 2002 3:50 PM
  To: Balint, Jess
  Subject: RE: Caching Large Data Structures To Disk
  
  
  It writes directly to the file.  Big caveat: don't try to store
  references in it.  Only simple hashes work.  Of course you could always
  store Data::Dumper created strings as the values.
  
  On Thu, 2002-02-14 at 15:28, Balint, Jess wrote:
   Sounds like a plan. If I open a dbm file, and read and write to the
 hash,
   will it read and write to the dbm file directly, or will it store that
  whole
   hash in memory until I tell it to write it back to the file? (sorry,
 dumb
   question)
   
   -Original Message-
   From: Chas Owens [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, February 14, 2002 3:29 PM
   To: Balint, Jess
   Cc: '[EMAIL PROTECTED]'
   Subject: Re: Caching Large Data Structures To Disk
   
   
   
   Hashes can be stored in dbm files.  Also you can use Data::Dumper to
   create a string that contains valid Perl syntax to create a give data
   structure.  You can then write that string to a data file.  When you
   need that data again you can read the file back into a string and eval
   it.  See perldoc -f dbmopen, perldoc -f dbmclose, and perldoc
   Data::Dumper for more info.
   
   
   
   On Thu, 2002-02-14 at 15:10, Balint, Jess wrote:
Hello all. First off, I want to thank everybody on this list who has
   helped
me with with my previous questions. Thank you.

I am working with input file of very large size. Sometimes up to and
   greater
than a gig of data. I have previously gotten out of memory errors
  (people
   at
work don't like when I do this). I was wondering if there was a way
to
   cache
large data structures to disk. We have a program here called SAS
that
  runs
on a Windows server (blek). Anyways, SAS allows me to operate on
  unlimited
sizes of data, and always uses large temp files. Maybe there is a
Disk::Cache module or something that I can use to store my data on
 disk
instead of memory. I know it will be slower, but is something I am
  willing
to deal with. TIA.

--J-e-s-s--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   -- 
   Today is Setting Orange the 45th day of Chaos in the YOLD 3168
   Kallisti!
   
   Missle Address: 33:48:3.521N  84:23:34.786W
  -- 
  Today is Setting Orange the 45th day of Chaos in the YOLD 3168
  
  
  Missle Address: 33:48:3.521N  84:23:34.786W
 -- 
 Today is Setting Orange the 45th day of Chaos in the YOLD 3168
 All Hail Discordia!
 
 Missle Address: 33:48:3.521N  84:23:34.786W
-- 
Today is Setting Orange the 45th day of Chaos in the YOLD 3168
Frink!

Missle Address: 33:48:3.521N  84:23:34.786W

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




RE: Checking Perl load

2002-02-15 Thread Timothy Johnson


You can also check
'HKEY_LOCAL_MACHINE\SOFTWARE\ActiveState\ActivePerl\CurrentVersion' to see
if it is installed.  That will be MUCH quicker, and won't slow down the
clients.

-Original Message-
From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 11:32 AM
To: 'Ned Cunningham'; [EMAIL PROTECTED]
Subject: RE: Checking Perl load


Then how about dir /s perl.exe?

Rob

-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:25 PM
To: Hanson, Robert; Ned Cunningham; '[EMAIL PROTECTED]'
Subject: RE: Checking Perl load


Yes, except I load the path separately, so it is on the systems.
I would need to check it in a bat file remotely.

-Original Message-
From:   Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent:   Friday, February 15, 2002 2:23 PM
To: 'Ned Cunningham'; '[EMAIL PROTECTED]'
Subject:RE: Checking Perl load

You can check to see if its in your path by typing perl -v
at the command
line, otherwise  just use the search finction, and search
for perl.exe.

Rob


-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 2:19 PM
To: '[EMAIL PROTECTED]'
Subject: Checking Perl load


I would be looking for a way to test if perl is loaded on a
NT machine.
Does anyone have a quick answer or command line to do this?

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



This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

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




Re: multiple __DATA__ entries possible?

2002-02-15 Thread Michael Fowler

On Fri, Feb 15, 2002 at 01:09:32PM -0800, Dennis G. Wicks wrote:
 Unfortunately, none of the fragments posted so far work as
 written! 

None?  The example I gave works just fine.


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: Regular Expressions - matching the first time

2002-02-15 Thread Russ Foster

 As of Perl 5.6.2 (not released yet), /^(.*?):/ and 
 /^([^:]*):/ will have the same efficiency (read: speed).  If 
 you're curious, currently /^.*?:/ and /^[^:]*:/ have the same 
 speed -- it's the capturing that killed .*?, but I have fixed that.

Just to be clear, it's the capturing (.*?) of the string that suffers the
most (performance-wise), correct? What do you mean you have it fixed--that
future versions of Perl don't suffer a hit?

 And personally, I'd use /([^:]*)/ instead of /^([^:]*):/, 
 since they match the same thing (assuming there IS a colon in 
 the string).  Or I'd use /(.*?):/ instead of /^(.*?):/ but whatever.

What's the reason for preferring not to use the '^' ? Is it speed? Or just a
desire to make a regex a simple as possible?

Personally, I prefer making my regexs (and scripts, in general) as explicit
as possible, even if it means taking a performance hit.

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




'argument isn't numeric' error in CGI script

2002-02-15 Thread Jim Witte

Hi,

   I'm running Apache on a MacOS X (10.1.2) box in IP-loopback mode, and 
I'm experiementing with a CGI script that acts like a state-machine.  I 
cooked up the example at the bottom of the page.  If I run it as is, it 
runs fine.  But if I comment out line 48, which tells action1 to exit 
when it finishes, the browser displays this message, after which it 
executes action2 (correctly):

t2.pl: Argument action2 isn't numeric in numeric eq (==) at file 
path line 16.

   What does this mean, and why does it only show up if the exit() 
statment is commented?  If I run it at the command line, it runs fine, 
exept it tells me that action1 and action2 are called too early to 
check their prototypes (which I expected). If I change the quotes in 
lines 14 and 16 to double-quotes, it sill exibits the same behavior.

Thanks,
Jim Witte
[EMAIL PROTECTED]


#!/usr/bin/perl
use CGI qw(:standard);
use diagnostics;
use CGI::Carp qw(fatalsToBrowser);
BEGIN {
  use CGI::Carp qw(carpout);
  carpout(STDOUT);
}
$commname = param('commname');
if (!$commname) {
dostart(); }
if ($commname == 'action1')  {
action1(); }
if ($commname == 'action2') {   line 16
action2(); }

sub dostart()
{
print header;
print start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
What's your name [dostart]? ,textfield('name'),
submit('commname', 'action1'),
end_form,
end_html;
exit();
}

sub action1()
{
print header,
start_html('Action 1 completion'),
[action1] Your name is , em(param('name')),
p,
end_html;
exit();   line 48 
}

sub action2()
{
print header,
start_html('Action 2 completion'),
[action2] Your name is , em(param('name')),
p,
end_html;
}



Re: multiple __DATA__ entries possible?

2002-02-15 Thread Dennis G. Wicks

Sorry, it doesn't *as written*.

It required a ; after 
@array1 = DATA

I revisited it and find that it does work after removing the
leading white space from the  EOD  line.

Yeah, it might be nit picking but those are the nits that
drive us beginners crazy! It apparently doesn't make a
difference that __DATA__ has leading white space, but
obviously a *big* difference if EOD does! (I have figured
out why. It is obvious from the results.)

Thanks for your contributions. They have helped me a lot!
Dennis


}On Feb 15, 10:55, Michael Fowler wrote:
} Subject: Re: multiple __DATA__ entries possible?
On Fri, Feb 15, 2002 at 01:09:32PM -0800, Dennis G. Wicks wrote:
 Unfortunately, none of the fragments posted so far work as
 written! 

None?  The example I gave works just fine.


Michael
--
Administrator  www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--
}-- End of excerpt from Michael Fowler



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




Re: multiple __DATA__ entries possible? -- use (a here document)

2002-02-15 Thread William.Ampeh


The closest you can get is to specify  a here document.  That is:




my @array=(END_DATA =~ m/^\s*(.+)/gm)
stuff in data
more stuff data
END_DATA
;

my @array1=(END_DATA1 =~ m/^\s*(.+)/gm)
stuff in data1
more stuff data1
END_DATA1
;

print \n This is DATA:\n@array\n\nThis is array1:\n@array1\n\n;


---


You can revise the REGEX to suit your purposes.


__

William Ampeh (x3939)
Federal Reserve Board


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




RE: Caching Large Data Structures To Disk

2002-02-15 Thread Chas Owens

Short answer: Yes.

Long answer:  You can tie a Perl variable to anything provided you
supply the necessary functions.  You will have to figure out how you
want that data structure to look on disk, which will involve turning
references in data and back again.  This will be a very large task,
especially if you want to do it with any amount of efficiency.  But if
you do do then please release it as a module on CPAN.

On Fri, 2002-02-15 at 14:34, Balint, Jess wrote:
 Would it be possible to use 'tie' to operate on a large complex data
 structure from disk?
 
 -Original Message-
 
 Well, I think some file systems can't handle file bigger than two gig,
 but I think that is the only limitation (I could be wrong, I don't use
 dbm for much).
 
 On Thu, 2002-02-14 at 16:35, Balint, Jess wrote:
  Is there a dbm file size limit that I have to worry about?
  
  -Original Message-
  From: Chas Owens [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, February 14, 2002 4:30 PM
  To: Balint, Jess
  Subject: RE: Caching Large Data Structures To Disk
  
  
  You will have to first use eval to revive the string.  Take a look at
  perldoc Data::Dumper.
  
  
  On Thu, 2002-02-14 at 16:06, Balint, Jess wrote:
   If I store strings from data dumper, can I still pull stuff off like
   retrieving values from an anonymous array stored in the hash while
 having
   the data stored on the disk? Or do I need to put the array in memory
  first?
   I guess the underlying question is does perl operate on data structures
 as
   plain text?
   
   -Original Message-
   From: Chas Owens [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, February 14, 2002 3:50 PM
   To: Balint, Jess
   Subject: RE: Caching Large Data Structures To Disk
   
   
   It writes directly to the file.  Big caveat: don't try to store
   references in it.  Only simple hashes work.  Of course you could always
   store Data::Dumper created strings as the values.
   
   On Thu, 2002-02-14 at 15:28, Balint, Jess wrote:
Sounds like a plan. If I open a dbm file, and read and write to the
  hash,
will it read and write to the dbm file directly, or will it store that
   whole
hash in memory until I tell it to write it back to the file? (sorry,
  dumb
question)

-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 3:29 PM
To: Balint, Jess
Cc: '[EMAIL PROTECTED]'
Subject: Re: Caching Large Data Structures To Disk



Hashes can be stored in dbm files.  Also you can use Data::Dumper to
create a string that contains valid Perl syntax to create a give data
structure.  You can then write that string to a data file.  When you
need that data again you can read the file back into a string and eval
it.  See perldoc -f dbmopen, perldoc -f dbmclose, and perldoc
Data::Dumper for more info.



On Thu, 2002-02-14 at 15:10, Balint, Jess wrote:
 Hello all. First off, I want to thank everybody on this list who has
helped
 me with with my previous questions. Thank you.
 
 I am working with input file of very large size. Sometimes up to and
greater
 than a gig of data. I have previously gotten out of memory errors
   (people
at
 work don't like when I do this). I was wondering if there was a way
 to
cache
 large data structures to disk. We have a program here called SAS
 that
   runs
 on a Windows server (blek). Anyways, SAS allows me to operate on
   unlimited
 sizes of data, and always uses large temp files. Maybe there is a
 Disk::Cache module or something that I can use to store my data on
  disk
 instead of memory. I know it will be slower, but is something I am
   willing
 to deal with. TIA.
 
 --J-e-s-s--
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Today is Setting Orange the 45th day of Chaos in the YOLD 3168
Kallisti!

Missle Address: 33:48:3.521N  84:23:34.786W
   -- 
   Today is Setting Orange the 45th day of Chaos in the YOLD 3168
   
   
   Missle Address: 33:48:3.521N  84:23:34.786W
  -- 
  Today is Setting Orange the 45th day of Chaos in the YOLD 3168
  All Hail Discordia!
  
  Missle Address: 33:48:3.521N  84:23:34.786W
 -- 
 Today is Setting Orange the 45th day of Chaos in the YOLD 3168
 Frink!
 
 Missle Address: 33:48:3.521N  84:23:34.786W
-- 
Today is Sweetmorn the 46th day of Chaos in the YOLD 3168
Pzat!

Missle Address: 33:48:3.521N  84:23:34.786W


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




fsck

2002-02-15 Thread Jose Vicente

Plese help me , how can I use fsck, because I had some errors.


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




RE: beginners Digest 15 Feb 2002 16:00:47 -0000 Issue 686

2002-02-15 Thread Rustagi, Dhiraj

Hello,

I would like to know if it is possible to add meta tags through a perl
program? I have a SHTML file which calls the Perl program and I want this
program to insert meta tags in the HEAD section of SHTML document.
Thanks

Dhiraj



Re: multiple __DATA__ entries possible?-- A cleaner way

2002-02-15 Thread William.Ampeh


#!{location of Perl}
#  Main Module --
my @array = one;
my @array1 = two;
print \n This is DATA:\n@array\n\nThis is array1:\n@array1\n\n;

#- BEGIN SUBS -
sub one {
 my @array=(END_DATA =~ m/^\s*(.+)/gm);
 stuff in data
 more stuff data
END_DATA
 @array;
}

sub two {
 my @array=(END_DATA =~ m/^\s*(.+)/gm);
 stuff in data1
 more stuff data1
END_DATA
 @array;
}

# Be careful not to indent END_DATA line
#--- END OF SUBS -
__

William Ampeh (x3939)
Federal Reserve Board


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




Re: fsck

2002-02-15 Thread Chas Owens

On Fri, 2002-02-15 at 15:47, Jose Vicente wrote:
 Plese help me , how can I use fsck, because I had some errors.
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


Well, fsck /devicepath/devicename is how you run fsck, but we need
more info on what those problems were to give you any helpful advice. 
How exactly does this relate to Perl?

-- 
Today is Sweetmorn the 46th day of Chaos in the YOLD 3168
Pzat!

Missle Address: 33:48:3.521N  84:23:34.786W


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




fsck

2002-02-15 Thread Jose Vicente

The error is :
need terminal for interactive
- Original Message - 
From: Jose Vicente [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 15, 2002 3:47 PM
Subject: fsck


 Plese help me , how can I use fsck, because I had some errors.
 
 
 -- 
 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: fsck

2002-02-15 Thread William.Ampeh


Chas wrote:
How exactly does this relate to Perl?


Well most times the Perl developer is forced to be the Systems Admin, and
most people on this list use Linux or some flavor of Unix, so I guess the
user
figured why not ask people on this list first?.

__

William Ampeh (x3939)
Federal Reserve Board


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




Re: fsck

2002-02-15 Thread Chas Owens

On Fri, 2002-02-15 at 16:04, Jose Vicente wrote:
 The error is :
 need terminal for interactive

snip / 

  Plese help me , how can I use fsck, because I had some errors.
  

snip / 

You might try answering these questions:

What is the name and version of your OS?
What is your location in relation to the machine the OS is running on?
When are you getting this error message?
Why are you running fsck?
What does this have to do with Perl?
What is the air speed of an unladen swallow?

-- 
Today is Sweetmorn the 46th day of Chaos in the YOLD 3168
Grudnuk demand sustenance!

Missle Address: 33:48:3.521N  84:23:34.786W


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




Re: fsck

2002-02-15 Thread William.Ampeh


Always fsck your block devices (/dev/dsk/c#t#d#s#) and not your raw device
names (/dev/rdsk/c#t#d#s#).

That is:
fsck /dev/dsk/c0t1d1s1
fsck /dev/dsk/c0t1d1s2


Also, you must be in maintenance or single user mode (linux single).

--



Also, please remember to use  fsck on the devices one at a time, and ask
Linux to correct
the bad sectors.

That is:

fsck ... Enter

When prompted for a response, press Enter key.

When fsck is done, repeat the process on the next device, and then the
next.

__

William Ampeh (x3939)
Federal Reserve Board


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




Re: fsck

2002-02-15 Thread Michael Fowler

On Fri, Feb 15, 2002 at 04:10:18PM -0500, Chas Owens wrote:
 What is the air speed of an unladen swallow?

African or European?


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


P.S.  Haven't we done this joke before?

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




HTML Template and HTML Mason

2002-02-15 Thread William.Ampeh

I am in the process of inheriting a bundle of Perl/HTML code implemented in
HTML:Mason

and

HTML::Template

For ease of maintenance I am planning to simply do away with one.

The question is which one?.  I have not done much in Mason, but from what
I have
read, it sounds very promising and makes the task of maintaining and
serving large web sites
much easier than HTML::Template

My question is, what are peoples' experiences when it comes to HTML::Mason
and HTML::Template?

Any tips will be very much appreciated.

__

William Ampeh (x3939)
Federal Reserve Board


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




Re: multiple __DATA__ entries possible?

2002-02-15 Thread Michael Fowler

On Fri, Feb 15, 2002 at 02:32:19PM -0800, Dennis G. Wicks wrote:
 Sorry, it doesn't *as written*.
 
 It required a ; after 
 @array1 = DATA

It required a ; after that statement provided you put statements after it.

 
 I revisited it and find that it does work after removing the
 leading white space from the  EOD  line.

All of the code was indented four spaces, for readability in email; it was
intended that the indentation should be removed prior to trying to use it. 
I assumed that was apparent.  I'll be more careful of it in the future.

Thank you for the feedback.

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

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




More help with my function

2002-02-15 Thread Steven M. Klass

Hi all,

Here is a simple script that I am having a heck of a time with.  I think it 
will become apparent what I'm trying to do.  Ask a question and validate the 
answer.

AskQuestion(Enter the hierarchical mode, my @hier = qw/inquiry smart 
yes/); 

sub AskQuestion {
  my $prompt = shift; 
  my @answers = @_;
  my $response;
  while ( ! $response ) { 
print $prompt [@_[0]];
$response = STDIN;
chomp $response;
if ( $response eq  ) {
  $response = @answers
} 
if ( $response eq ?) {
  $response = ;
  print Valid answers are: \n; 
  print @answers\n; 
}
  print \n;

my $match;
for ( my $i = 0; $i  @answers ; $i++ ){
  if ( $response eq $answers ){
$match = true;
return $response;
  }
}
if ( ! $match ){ $response = ;}
  } 
}

I think it must be friday or something, but could someone help me clean this 
up.  I want something simple, and I think I have over-engineered this.  Any 
help is appreciated!

Thanks so much.  I love this list!:)  
-- 

 Steven M. Klass
 Physical Design Manager

 National Semiconductor Corp
 7400 W. Detroit Street
 Suite 170
 Chandler AZ 85226

 Ph:480-753-2503
 Fax:480-705-6407

 [EMAIL PROTECTED]
 http://www.nsc.com


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




RE: fsck

2002-02-15 Thread James Kelty

snip /

What is the air speed of an unladen swallow?

snip /

What? African or European?

-James
 
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 1:10 PM
To: Jose Vicente
Cc: perl beginners
Subject: Re: fsck


On Fri, 2002-02-15 at 16:04, Jose Vicente wrote:
 The error is :
 need terminal for interactive

snip / 

  Plese help me , how can I use fsck, because I had some errors.
  

snip / 

You might try answering these questions:

What is the name and version of your OS?
What is your location in relation to the machine the OS is running on?
When are you getting this error message?
Why are you running fsck?
What does this have to do with Perl?
What is the air speed of an unladen swallow?

-- 
Today is Sweetmorn the 46th day of Chaos in the YOLD 3168
Grudnuk demand sustenance!

Missle Address: 33:48:3.521N  84:23:34.786W


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




  1   2   >