[Doubt] : Validate Printer Port

2004-06-23 Thread suresh.pasupula
Hi, How to validate the given printer port? I want to know if it is a TCP/IP or local port. If it is a TCP/IP Port then I wan to validate if it exists (Raw port 9100). Also I want to validate the format of IP-Address. Could anyone let me know how can I achieve this? Thanks and Regards

Re: cut and substitute

2004-06-23 Thread John W. Krahn
Amit Virmani wrote: > > Problem: > I have a field $cusip that has to change from ABC123-XX-7 (9 characters with '-') to > ABC123XX (first 8 characters only without '-') > > I have following lines of code: > : > : > $cusip =~ s/\-//g; > $cusip =~/.${8}$/$1/g; > : > : > > Is there a shorter way t

Re: The Proper way to define a global variable.

2004-06-23 Thread Chris Welch
> From: John W. Krahn wrote: > Jason Corbett wrote: > > > > Hello. I am using variables that are local in my scripts by doing the my > > $variable_name technique. > > > > Can someone tell me if there is an official way to define a global variable? > > Perl doesn't really have "global" variab

Re: a way to make this more secured and better written?

2004-06-23 Thread Jason Gray
or would this be much better? #!/usr/bin/perl -T use strict; use warnings; use CGI(); use Mail::Mailer; my $q = CGI->new(); # Email address where form submits are sent. my $email = '[EMAIL PROTECTED]'; # Your subject for the form submits. my $subject = '[INFO] Site Comment'; print $q->header

Re: open CONSOLE?

2004-06-23 Thread Randy W. Sims
perl.org wrote: Hi, Is there a way to explicitly open a handle to the "console", or wherever STDOUT/STDERR are directed to by default? My process is running in an environment in which STDOUT and STDERR have already been redirected. I want to intercept these streams when running command line to

Re: warning with eval, not with inline

2004-06-23 Thread Randy W. Sims
perl.org wrote: Given this piece of code (where ${components[${i}]} is 'email'): eval { my ${name} = 'IWAPI::ExternalTasks::' . ${components[${i}]}; no strict; eval( &${name}( -files => [EMAIL PROTECTED], -area => ${area}, -wftask => ${wftask}, -wfworkflow => ${wfworkflow}

Re: open CONSOLE?

2004-06-23 Thread Randy W. Sims
perl.org wrote: Hi, Is there a way to explicitly open a handle to the "console", or wherever STDOUT/STDERR are directed to by default? My process is running in an environment in which STDOUT and STDERR have already been redirected. I want to intercept these streams when running command line to

Re: open CONSOLE?

2004-06-23 Thread LRMK
For windows try this sub executeTool($){ my ($toolPath) = @_; my $comspec = $ENV{'COMSPEC'}; # Get the path to the command line interpriter if this ENV var is not available in your system you will need to hard code this part open(TOOL, "$comspec /c $toolPath|"); my $result = ;

writing to a DOC

2004-06-23 Thread John
I have store a greek text in mysql database field. Using my script i retrieve the greek text and then i store it in a file.doc. When i email the file.doc (through MIME::Lite) i can open it with the Microsoft Word and then it asks me the encoding of the document. I click on simple text and i can

Quoting a scalar in a substitution

2004-06-23 Thread Richard Barrett-Small
Hello all, Will really appreciate help with this: I'm pulling my hair out with this one. I have a list of contents in the @contents array and the script finds those headings in the html and adds anchors to them. The trouble is, the substitution won't match when there's a question mark in the cont

Re: Quoting a scalar in a substitution

2004-06-23 Thread James Edward Gray II
On Jun 23, 2004, at 11:23 AM, Richard Barrett-Small wrote: Hello all, Howdy. Will really appreciate help with this: I'm pulling my hair out with this one. I have a list of contents in the @contents array and the script finds those headings in the html and adds anchors to them. The trouble is, th

Using MIME::Lite to send mail/or attachments

2004-06-23 Thread jason corbett
Can anyone tell me where I can find MIME::Lite or any other perl method to send attachments/documents in mail format? If you have tips or scripts on using it to send mail (documents attached), please let me know. Thanks, JC

Re: Using MIME::Lite to send mail/or attachments

2004-06-23 Thread Wiggins d Anconia
> > Can anyone tell me where I can find MIME::Lite or any other perl method to send attachments/documents in mail format? If you have tips or scripts on using it to send mail (documents attached), please let me know. > MIME::Lite can be found on CPAN with most other modules. You can use, perl

pattern matching

2004-06-23 Thread Murzc
Hi, I have a string similar to: Comment: FILING This is read in as one line (with the page feed). I was trying to whatever follows the words and I tried this. if (/(\w+:?\s*\w*:?)+(.*?\*+\s*-+\s*\*+\s*$)/) {

Re: pattern matching

2004-06-23 Thread James Edward Gray II
On Jun 23, 2004, at 12:34 PM, [EMAIL PROTECTED] wrote: Hi, I have a string similar to: Comment: FILING --- - This is read in as one line (with the page feed). I was trying to whatever follows the words and I tried this

Re: pattern matching

2004-06-23 Thread James Edward Gray II
(Let's keep our discussion on the list for all to see.) On Jun 23, 2004, at 12:44 PM, [EMAIL PROTECTED] wrote: Let's try to get a little simpler with our approach. Does >this grab what you need? m/(\W+)$/ James What a quick response. Thanks. No problem. I assume you mean do this? Am I right? m/

Re: pattern matching

2004-06-23 Thread Murzc
OK. I am reading a file. This line is at the bottom of the file and the "---**" is a sign that the section is complete. I need to be able to pick up that line, and see if there is also code on the beginning of that line that I need to save. So in this case I was searching for wo

RE: pattern matching

2004-06-23 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi, > > I have a string similar to: > Comment: FILING > --- - > > This is read in as one line (with the page feed). > I was trying to whatever follows the words and I tried this. Trying to rem

Re: pattern matching

2004-06-23 Thread Murzc
>Would something like this do the trick? > $_ = $1 if /((\s*\w+:?)+)/; True. But I need to test the line to see if it contains those '*--**'. Otherwise how do I know that the line needs to be edited. (I am reading a file with many lines. I have to detect when the line comes with th

Re: pattern matching

2004-06-23 Thread James Edward Gray II
On Jun 23, 2004, at 12:59 PM, [EMAIL PROTECTED] wrote: OK. I am reading a file. This line is at the bottom of the file and the "---**" is a sign that the section is complete. This may be a sign that you aren't reading the file in the easiest possible way. I wonder if setting th

Re: Re: Comparing Directories

2004-06-23 Thread sudhindra k s
Hi Thanks. I tried this script. It compares the filenames within the directory very well. But i want to compare even the contents and report the differences between the files. Regards Sudhindra   On Tue, 22 Jun 2004 LRMK wrote : > >This must do the STYLE="text-decoration: none; border-botto