Re: used sendmail to send an attachment

2003-01-26 Thread Johnathan Kupferer
Sendmail.pm should be at: /opt/MIMperl5/lib/5.00503/sun4-solaris/Mail/Sendmail.pm The Mail:: prefix translates into a directory, hence the message: Can't locate Mail/Sendmail.pm in @INC - Johnathan Nilesh wrote: I have download Sendmail module and installed. I also copied Sendmail.pm in my

Re: changing backgorund color error

2003-01-25 Thread Johnathan Kupferer
You should reconsider using the bgcolor property at all since it has been depreciated. Depends on why it has been deprecated. It works. It's very backwards compatible. It is much more portable than style specifications. Quite true. You have to even drag out the font tags for compatabilit

Re: changing backgorund color error

2003-01-25 Thread Johnathan Kupferer
Not to be too much of a pain but... You should reconsider using the bgcolor property at all since it has been depreciated. Consider using CSS like:
body {background-color: #004152; }
... Or at least: From the looks of your code, I'm wondering if you 'use strict'. If you

Re: write a parser using perl

2003-01-25 Thread Johnathan Kupferer
You'll want to look at: perldoc -f pack perldoc -f unpack if you're working with fields of pre-determined lengths and the database files aren't delimited. Perhaps if you could post an example we could give you better advice. - Johnathan Wiggins d'Anconia wrote: tao wang wrote: thanks.

Re: Email function question

2003-01-24 Thread Johnathan Kupferer
Don't use sendmail. Use one of the perl modules designed to communicate with SMTP servers like Mail::Sender or Mail::Sendmail (which, confusingly enough has nothing to do with the sendmail program). The documentation that comes with these modules should be more than enough to get you going.

Re: DBI really quick question

2002-03-20 Thread Johnathan Kupferer
Hanson, Robert wrote: >"How do I CREATE a database from within perl with MySQL?" > >I don't think you can... but you can run the mysql interface from the >script. Actually I think that you can pipe a list of commands to mysql. > >Rob > If you can get a connection with proper permissions, all yo

Re: DBI really quick question

2002-03-19 Thread Johnathan Kupferer
You could connect to the mysql database. You don't need any permissions to connect to a database, so this should work out fine. Though, the question remains as to how you will set up the permissions from a perl script. If you can use the mysqladmin, then you could always create the database

Re: Help on debugging

2002-03-18 Thread Johnathan Kupferer
I don't quite know where to begin... Was the AIX box running ancient version of perl? I'm not surprised this won't compile. There's already been one response, so I'll try to stick to what hasn't been said, implementing the changes mentioned in the previous mail. > # !/usr/bin/perl > > # !Mo

Re: making phone calls using a perl module

2002-02-28 Thread Johnathan Kupferer
I would also be interested if anyone knows how to do this. We have several system monitors that would be much more efficient if they could actually call us when there is a problem rather than just sending email. We have a pager that can recieve email, but that only helps whoever has the page

Re: Converting windows txt file format to Linux txt file format

2002-02-22 Thread Johnathan Kupferer
You don't need perl for this. The easiest approach is to use the "dos2unix" utility. Use "man dos2unix" for more information. - Johnathan Lilian Alvarenga Caravela Godoy wrote: >Hi everyone > >I am trying to upload a windows txt file to a Linux server. > >There are an application running in

Re: php and perl

2002-02-22 Thread Johnathan Kupferer
In my humble opinion, it doesn't make sense to break up the script that generates the form and the one that validates it. Its hard enough to maintain an application without having to worry about two scripts in two different languages for something as simple as presenting and validating a form

Re: Win32::ODBC

2002-02-21 Thread Johnathan Kupferer
This looks like an issue we ran into when connecting with MS-SQL 7. Try using two different database handles, one handles the query and the other one to perform the inserts. You also were missing a semi-colon after your print, but I think that was probably an error in copying the code to the

Re: ifconfig and too many pppd's

2002-02-21 Thread Johnathan Kupferer
Basically, you want to run ifconfig to get a list of which interfaces are up and then look for ppp devices: open IFCONFIG, "ifconfig |"; my @interfaces; while(){ next unless /^(ppp\d+)/; push @interfaces, $1; } close IFCONFIG; This should give you what an array of what interfaces are u

Re: Simple Perl Ping Sweep (Windoze)

2002-02-20 Thread Johnathan Kupferer
Ted Lee wrote: >Hey guys, > >I've been playing with Perl, and I've built a simple ICMP Ping sweep program >that accepts start and end IP, and pings every host in between. > >Question I have is, I want to reduce the time it takes to do so, I was >considering spawning a processes for X number of ho

Re: qw for variables?

2002-02-19 Thread Johnathan Kupferer
Dennis G. Wicks wrote: >Greetings; > >No, I mean if $names contains "Jesus Mary Joseph" and I do > > my @n = qw( $names ); > >I want the same results as if I had done > > my @n = qw( Jesus Mary Joseph ); > >Obviously qw() does not work this way, but I can't find the >equivalent that d

Re: PERL - JAVASCRIPT Help please

2002-02-19 Thread Johnathan Kupferer
This really isn't a perl question. Write out your javascript in a simple HTML file and see if that works. If it does then port write the perl code to output that HTML. This isn't the forum for this but... When you call nwin.document.write() you should be passing HTML, not just any old stri

Re: is it a bug? (less-equal compare)

2002-02-14 Thread Johnathan Kupferer
lt, le, ge, gt, eq, ne and cmp all do lexical comparisons. <, <=, >=, >, ==, !=, and <=> do numerical comparisons. "89" le "100" is false. but "89" <= "100" is true. If you are trying to sort lexcally but you have some numeric data tossed in: @array = ('foo','bar','23 Skidoo','pizza',',100 b

Re: forks or thread for perl on win32

2002-02-14 Thread Johnathan Kupferer
In parent.pl, >$child{$pid} = {in=>$in,number=>$i,event=>$event,called=>1}; was supposed to be: $child{$pid} = {in=>$in,out=>$out,number=>$i,event=>$event,called=>1}; - Johnathan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: forks or thread for perl on win32

2002-02-14 Thread Johnathan Kupferer
I just responded to a similar post "Forking in NT" but... Use open2 or open3 to comunicate with child processes. If you're just coding for win32 then you may want to also look at the Win32 modules, especcially Process.pm and Event.pm. There are some examples in C:\Perl\site\lib\Win32. Below

Re: Forking in NT

2002-02-14 Thread Johnathan Kupferer
My advice is not to use fork if you want your script to run cross platform. You will have enough problems writing cross-platform, multi-process perl code without dragging fork into it. The safest and simplist way to do what you want is to use open2 or open3 to pipe to and from child processe

Re: foreach loop problems

2002-02-13 Thread Johnathan Kupferer
I was actually surprised to see that ssh worked like this! I don't think you can always get away with it, but I just tested it out and was able to call up ssh for 4 different machines using a script similar to that one. I don't think all programs are going to be that nice. Can anyone explain

Re: foreach loop problems

2002-02-13 Thread Johnathan Kupferer
# Create array @hosts... So far so good. my @hosts=qw( lunar solar venus mars saturn pluto ); # \@hosts creates a reference to @hosts. You just want @hosts. # # The way you've written it, the elements in @hosts will be # assigned to the special variable $_. This is all right, but # tends to ge

Re: array references

2002-02-13 Thread Johnathan Kupferer
Jon Serra wrote: >Greetings, > >I have an array, each element will contain a reference to another array. How >can I dynamically generate each of those references such that each reference is >unique. I am trying to create dynamic 2d arrays. TIA JON > # # The key is understanding 'my' an

Re: regex question

2002-02-13 Thread Johnathan Kupferer
> > >client=& # 8 digits and then ampersand > >so what I want to strip out is stuff like: > >client=23894749& > You want something like: $url =~ s/client=\d\d\d\d\d\d\d\d&//; or if you don't want to count those \d's $url =~ s/client=\d{8}&//; And since cilent=& probably can pr

Re: [OT] Have a project? Need help? I'm your man

2002-02-12 Thread Johnathan Kupferer
You might want to look for volunteer oprotunities in your area. Its a great way to promote open-soure while building your resume. Schools and non-profits are often in need of people to put together networks, websites, and databases. The great thing about it is they're greatful for your help

Re: Stripping windows CR/LF characters

2002-01-25 Thread Johnathan Kupferer
Brett W. McCoy wrote: >On Fri, 25 Jan 2002, IT Workflow - Terry Honeyford wrote: > >>I am trying to print out only the lines that begin with Either "Unable to >>attach to", OR "Backup of" >>and append to the line "NOT OK" or "OK" depending on which match I get >>Here is the offending bit of scrip

Re: news articles database

2002-01-22 Thread Johnathan Kupferer
Unless these are massive files I would say just store them in the MySQL database as a text field. Don't worry about your markup DBI's quote method will take care of all of that nastiness. If you are set on having separate files, I would say just make them HTML snippets and name them however

Re: connecting perl to windows db

2002-01-22 Thread Johnathan Kupferer
If you are connecting from a Win32 machine to a database you can configure your ODBC databases through the control panel. Lets say you called the database 'example'. You can now connect to the database using: my $dbh = DBI->connect('dbi:ODBC:example',$user,$passwd); Of course, you will have

Re: regex issues

2002-01-18 Thread Johnathan Kupferer
Try: /\[GUARD\] ([^<>]+)<(\d+)><(\d+)><([^<>]+)> ([^<>]+) <({^<>]+)>/ To limit the characters you were matching with '.' to anything but angle brackets or: /\[GUARD\] (.+?)<(\d+?)><(\d+?)><(.+?)> (.+?) <(.+?)>/ To cause the matching to be non-greedy and not swallow up the ">

Re: Cgi on IIS

2002-01-16 Thread Johnathan Kupferer
Hanson, Robert wrote: >It's been a long time since I worked on IIS, but I believe the "Method not >allowed" error refers to GET, POST, PUT, and HEAD. In IIS you can >allow/deny each of these, but I forget exactly where in the MMC that this >was located, it was with the file types. > >So maybe ".

Re: Conditional Expressions

2002-01-16 Thread Johnathan Kupferer
In perl: (($n < 1) || ($n > 12)) is true when n is less than 1 or if n is greater than 12. Try this: for my $n (-5..17){ if (($n < 1) || ($n > 12)) { print "True for \$n = $n\n" } else { print "False for \$n = $n\n" } } Double check your logic. Are you sure you're

Re: Thumbnail images on-the-fly

2002-01-16 Thread Johnathan Kupferer
Your choices are basically GD or Image-Magick I've had good experiences with both. Image::Magick is more full featured but slower so if you're doing anything on the fly you should use GD, but if its just a one pass sort of thing (and I think that is what you're doing) then Image::Magick is be

Re: take the file name in as an argument of the function

2002-01-16 Thread Johnathan Kupferer
> > >But how could I take two arguments from the command line: > >i.e. my guess: > >%Test.pl "Foo" "Bar" > >#/!/usr/bin/perl > $A = $ARGV[0]; > $B = $ARGV[1]; > print "Thing A: $A Thing B: $B"; > I think you already answered your own question! Though your shebang line should be "

Re: Storing a Decryptable Password?

2001-10-02 Thread Johnathan Kupferer
You could limit the password complexity to a level to where you could use a brute force attack to crack it in a few (seconds|minutes|hours). Of course that means that someone else would be able to as well, but if they can get to the encrypted passwords then your in trouble already. The passwo

Re: system calls

2001-09-21 Thread Johnathan Kupferer
> > >I did this in one of my programs and it seemed to work just fine: > >system("$command &"); > Check it out again. contents of child.pl: #!/usr/bin/perl sleep 10; print "child exiting\n"; contents of parent.pl #!/usr/bin/perl system( "perl child.pl &" ); print "parent exiting\n"; You will

Perl Proxy Filtering

2001-05-03 Thread Johnathan Kupferer
I know this probably isn't a beginners question... I need to set up a proxy server to filter IFRAME tags before a thrid party piece of software sees them and chokes on them. The third party application is good about listening making requests using a proxy on any port I want, I just need a pro

Re: FileCache - use strict

2001-04-30 Thread Johnathan Kupferer
This one got under my skin so I did a little research: > use strict; > use FileCache; > my $a01; > $a01 = 'a01file'; > cacheout $a01; > print $a01 "XYZ\n"; It seems that perl decides that its calling print with arguments '$a01 "XYZ\n"' and then chokes on the argumen

Re: FileCache - use strict

2001-04-30 Thread Johnathan Kupferer
The error is a bit misleading. The problem is you need an operator between $ao1 and "XYZ\n". Try: print $a01, "XYZ\n"; or print $a01 . "XYZ\n"; This should clear things up. I don't know whay perl is trying to do with it if you don't "use strict"... - Johnathan > > How can I fix this so

Re: Passing Variables in Subroutines

2001-04-30 Thread Johnathan Kupferer
> @parms = @_; > ($user, $user_list, $tag) = split /,/, $parms; Did you mean: my($user, $user_list, $tag) = @_; Try using: use strict; at the top of every script. The problem is that @parms is not $parms. In fact, $parms is undefined, and use strict would point out this error. Yo

Re: Got a project for Perl but need some help

2001-04-30 Thread Johnathan Kupferer
Honestly, I've never had to. I would use Mail::Mailer except I don't see it with ActiveState's ppm. Its possible with Mail::Sendmail, looking at the source I see the note: Look at http://alma.ch/perl/Mail-Sendmail-FAQ.htm for additional info (CGI, examples of sending attachments, HTML mai

Re: Got a project for Perl but need some help

2001-04-30 Thread Johnathan Kupferer
Aww... you should have let him hire a consultant. ;o) Seriously though, this is dead simple. Gary's code is great and robust if a bit intimidating for a newbie. You said you have background in VisualBasic and that would lead me to think you might be using windoze NT or 2000. (Unfortunately

Re: subroutines in .pm

2001-04-27 Thread Johnathan Kupferer
Try throwing this into file2.pm: sub AUTOLOAD { print "What hath god wrought?\n" } And then call: file2->any_function_name; That is if you have a: use file2; AUTOLOAD is a catch all function, method really, but this should work considering how Perl blurs the line b

Re: Clarification - Re: Include directory as location of perl script

2001-04-27 Thread Johnathan Kupferer
Camel Book, page 851: One solution for this is to use the standard FindBin module: use FindBin; use lib $FindBin::Bin; This will do just what you want. By the way, to anyone who will listen: Get the Camel Book, "Programming Perl 3rd ed." published by O'Reilly. If you are serious abo

Re: Beginner's question

2001-04-27 Thread Johnathan Kupferer
> > #!/usr/local/bin/perl > use strict ; > my $ucmvob = "/ebppvobstore/vobs/UCMCQ" ; > my $PR_NAME = ; > my $vobname = `cleartool lsproject -invob $ucmvob | grep $PR_NAME` ; > my @prjname = split /\s+/, $vobname ; > my $prjstream = `cleartool lsstream -in @prjname[1]\@$ucmvob | grep Int` ; Did

Re: how to execute a windows 2000 command with perl

2001-04-26 Thread Johnathan Kupferer
Probably the easiest way to do this is if the machine that will be running the command is a web server. You can just set up the script you want to run as a cgi and have the calling script call the cgi via http. Now, this is assuming alot, like security is not an issue and your web server has

Re: void context, looping example

2001-04-25 Thread Johnathan Kupferer
The void context means that you're doing something that does nothing useful. $num * 3; Takes the value of $num, multiplies it by 3 and then trows the result away, leaving $num unchanged. I think you want *= like this: use strict; print "Please type an integer: "; chomp( my $num = ); while(

Re: More Help: Complex Regex

2001-04-24 Thread Johnathan Kupferer
There's already a lot of good advice here, but just one more thing... Some people write HTML code like this Using: s/<.*?>//g Doesn't account for that and it won't match. To allow '.' to match line breaks in tags, use: s/<.*?>//gs - Johnathan