Re: Perl and mouseover

2004-04-19 Thread Morten Liebach
On 2004-04-19 03:11:03 -0500, Jerry Preston wrote:
 I am trying to figure out how and what is the best and simplest way to use
 mousover in a per script.  All I want to do is display some text data.  Any
 ideas?

It sounds like you want to use Perl as JavaScript.  You can't do that.
Either make you perl code output some JavaScript (which I know nothing
about) in the document or add a 'title' attribute on the element, like
eg.:

a href=doc.html title=Popup descriptionlink text/a

The title attribute works on most HTML tags, but not all browsers use
them the same way.

Have a nice day
 Morten

-- 
http://m.mongers.org/ -- http://zentience.mongers.org/
__END__

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: How to determine if STDIN has piped data?

2004-04-01 Thread Morten Liebach
On 2004-03-30 21:35:21 -0700, Bryan Harris wrote:
 
 
  On Mon, 29 Mar 2004 00:38:50 -0700
  Bryan Harris [EMAIL PROTECTED] wrote:
  
  Alternatively, you can use the '-t' operator:
  
  exit 0 if -t STDIN
  
  
  I've been waiting for this for a LONG time, thanks Smoot.
  
  No problem.  It took me a while to find the correct operator as well.
  
  Please keep in mind that doing this breaks the de facto Unix standard
  for filters.  A simply command which is a filter (e.g takes
  input from STDIN and sends output to STDOUT) is written without any
  consideration whether the input is a terminal, pipe, socket or
  otherwise. This makes it very simple to use the command in a pipeline or
  standalone from the terminal.
 
 [stuff cut out]
 
 Smoot,
 
 Strangely, I find that we almost always want our scripts to act this way.
 If any files or data is passed to the script, then it uses it.  Otherwise,
 it prints usage instructions (since we'd rather not have man pages for
 scripts, and I don't know how to build them anyway).

Use POD.  See 'perldoc perlpod' for all the details.

Then the user can just run 'perldoc scriptname' (provided 'scriptname'
is in $PATH) and get a nicely formatted manpage.

Have a nice day
 Morten

-- 
http://m.mongers.org/ -- http://zentience.mongers.org/
__END__

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Reformatting the Date

2004-03-04 Thread Morten Liebach
On 2004-03-03 11:54:51 +0200, John wrote:
 I receive the date from the Oracle as DD/MM/YY and i want to insert
 that date in a mysql date field.
 
 I know that mysql date form is -MM-DD.
 
 Well, do you know if there is any date function to do the job?

Yes, Date::Manip, it can do almost anything with dates.

 Morten

-- 
http://m.mongers.org/
__END__

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Use strict (beginner question)

2003-04-04 Thread Morten Liebach
On 2003-04-03 14:05:19 -0500, [EMAIL PROTECTED] wrote:
 
 All,
 
 I added the use strict; statement to my script for the first time and
 received the following compilation errors:
 Global symbol $LoginName requires explicit package name at todaysFiles.pl
 line 43.
 Global symbol $TMPNow requires explicit package name at todaysFiles.pl
 line 45.
 Global symbol @filenames requires explicit package name at todaysFiles.pl
 line 48.
 Global symbol $filenames requires explicit package name at todaysFiles.pl
 line 49.
 
 This program works fine without the use strict statement?.please advise!!
 
Use something like:

my $LoginName;
my $TMPNow;

Etc.

 Also, can someone offer an explanation of how = differs from = =??

I suppose you meant == instead of = =.

= is an assignment.  == is a comparison.
 
I can recommend Learning Perl or one of the other nice beginners books,
you wouldn't get into these things then.  And use strict and warnings
always, from the beginning of all new scripts, it helps a lot.

Have a nice day
 Morten

-- 
OpenPGP: 0xF1360CA9 - 8CF5 32EE A5EC 36B2 4E3F  ACDF 6D86 BEB3 F136 0CA9
 Morten Liebach [EMAIL PROTECTED] - http://m.mongers.org/

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



Re: embedding perl in html

2003-03-26 Thread Morten Liebach
On 2003-03-26 16:29:27 -0800, David O'Dell wrote:
 Is there a way to place a perl statement in a plain html file?
 I've been given the task of placing two pieces of dymanic data in an 
 already existing page written in html.

http://perl.apache.org/embperl/ perhaps?  Haven't tried myself.

I'm right now making a website using perl cgis included via Apaches SSI,
that's another possibility.

Hope this helps
 Morten

-- 
OpenPGP: 0xF1360CA9 - 8CF5 32EE A5EC 36B2 4E3F  ACDF 6D86 BEB3 F136 0CA9
 Morten Liebach [EMAIL PROTECTED] - http://m.mongers.org/

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



Re: Using Print -strange behavior

2003-03-24 Thread Morten Liebach
On 2003-03-24 07:27:14 -0800, Ovid wrote:
 --- Jose Luis Martinez [EMAIL PROTECTED] wrote:
  Hello Ovid
  
  This is the code that I am trying to run
  
  #!/usr/bin/perl
  
  my $a=Hello World;
  
  print $a;
 
 There is nothing wrong with this code.  Thoughts:
 
 * what is the result of 'which perl'?  Are you pointing to the same interpreter? 
 (though this
 should not make a difference)
 
 * are your line endings wrong?
 
Try:


#!/usr/bin/perl

my $greeting=Hello World\n;
print $greeting;


With my shell prompt the \n in $greeting is necessary, else the output
is eaten by the prompt.

Hope this helps
 Morten
 
-- 
OpenPGP: 0xF1360CA9 - 8CF5 32EE A5EC 36B2 4E3F  ACDF 6D86 BEB3 F136 0CA9
 Morten Liebach [EMAIL PROTECTED] - http://m.mongers.org/

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



Re: How do you put a delay/pause/wait in Perl?

2002-08-13 Thread Morten Liebach

On 2002-08-13 12:40:32 -0400, [EMAIL PROTECTED] wrote:
 I've searched online, but it's difficult when I have no idea what the
 command is.  
 
 I want to have a script execute, but if a condition is not met, for it to
 wait five minutes and try again.  I would prefer to do this without using a
 'while' loop, because I don't know what that would do to the system load.

Is 'perldoc -f sleep' what you're looking for?

It's just like in Unix sleep(1). :)

Have a nice day
 Morten

-- 
Morten Liebach [EMAIL PROTECTED], http://m.mongers.org/
PGP-key: http://m.mongers.org/m_gpg.asc

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




Re: Uptime on Remote computer?

2002-08-12 Thread 'Morten Liebach'

On 2002-08-12 01:50:50 -0800, Mark Weisman wrote:
 I built the script as you said, however, I'm getting an error that I
 can't get around in my error file;
 
 Could not create directory '/nonexistent/.ssh'.^M
 Aborted by user!^M
 
 Any ideas?

This is a ssh problem. ssh is not set up to use public key
authentication for this user which seems to be some non-priviledged
daemon account.

To use public key athentication the user needs a real homedir with a
~/.ssh dir containing the file authorized_keys. Then it'll work.

This is OT for this list, I'll send you a more elaborate personal reply
in a short while.

Have a nice day
 Morten

  script begin 
 #!/usr/bin/perl -w
 
 use strict;
 
 my %machines = (
 firewall = 'admin',
 samba = 'operator',
 web = 'bofh',
 );
 
 foreach my $host (sort keys %machines) {
 print $host . ':' . `ssh -l $machines{$host} $host uptime`;
 }   
  script end 

-- 
Morten Liebach [EMAIL PROTECTED], http://m.mongers.org/
PGP-key: http://m.mongers.org/m_gpg.asc

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




Re: Uptime on Remote computer?

2002-08-11 Thread Morten Liebach

On 2002-08-11 13:19:13 -0800, Mark Weisman wrote:
 Hello List:
   What is the command structure to grab an uptime request from a remote
 computer? I have several systems in my organization that I would like to
 grab the uptime for, then post them to a dynamic web page. The web page
 I've already got done, I just need the command structure for grabbing
 the uptime. Help in grabbing uptime from a Win32 box would be helpful as
 well. I'm trying to grab data from a group of FreeBSD boxes, and a
 singular Win2K box. Any suggestions?

I can't help you with Win2K, but the FreeBSD boxen are easy. I tried this
thing:

 script begin 
#!/usr/bin/perl -w

use strict;

my %machines = (
firewall = 'admin',
samba = 'operator',
web = 'bofh',
);

foreach my $host (sort keys %machines) {
print $host . ':' . `ssh -l $machines{$host} $host uptime`;
}   
 script end 

Example Output:
firewall: 3:47AM  up 18 days, 10:44, 0 users, load averages: 0.00, 0.00, 0.00
samba: 2:46AM  up 38 days,  2:05, 6 users, load averages: 0.20, 0.17, 0.17
web: 3:47AM  up 1 day,  9:14, 2 users, load averages: 0.14, 0.15, 0.17

Names changed to protect the guilty, but it's tested, and it Works For
Me[TM].

Caveat:
You need to have your ssh setup to use public key auth, and have a
ssh-agent(1) running on the machine your running the script on. This is
a minor thing, as you should have this already. :)

Possible solution for a Win2K box:
Install Cygwin on it, and run an sshd on it, then it'll look just like
the BSD machines scripting wise. I haven't tried this as I have no
Microsoft OS'en with me ATM.

Have a nice day
 Morten

-- 
Morten Liebach [EMAIL PROTECTED], http://m.mongers.org/
PGP-key: http://m.mongers.org/m_gpg.asc

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




Re: Looking for multi platform to test my script.

2002-08-03 Thread Morten Liebach

On 2002-08-04 02:16:16 +0800, Connie Chan wrote:
 Now, I am working on a Win32 OS, scripts here seems working fine.
 But I hope to test my scripts on a *nix system too... Could you suggest
 me where to have a free account to run CGI (better can use most of 
 standard modules with Perl too) ?

Most web-hosting companies will let you run cgi scripts at your site, but
with what version of Perl, and with which modules is beyond your
control.  They usually won't give you a shell, so it's quite slow and
annoying to work with.

If I were you I'd install BSD or Linux on a spare machine and use it for
development.  You can also install it in VMWare on your normal
workstation, but that takes a pretty hefty machine, and VMWare isn't
cheap at all.

Hope this helps, have a nice day
 Morten

-- 
Morten Liebach [EMAIL PROTECTED], webpages at http://kallisti.dk/
PGP-key: http://kallisti.dk/ml.asc or Key-ID 0xD796A4EB on keyserver.net

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




Re: The True Guide to Learning Perl was Re: Thank You! :)

2002-07-17 Thread Morten Liebach

On 2002-07-16 12:22:45 -0700, drieux wrote:
 Or are you folks just DEMONS in PerlieCoderCloth,
 trying to lead the innocent into Perdition
   Perldition? };-)

-- 
Morten Liebach [EMAIL PROTECTED], webpages at http://kallisti.dk/
PGP-key: http://kallisti.dk/ml.asc or Key-ID 0xD796A4EB on keyserver.net

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




Re: M$ Word to HTML

2001-08-07 Thread Morten Liebach

On  7, Aug, 2001 at 12:11:29PM -0400, Mark Saunders wrote:
 Yeah, the dreamweaver 'Clean up Word HTML' is amazing.  
 It does miss some tags, like class, so you have to take an extra step or
 two to remove them.

HTML-TIDY claims to be able to clean up dirty Word html, get it from
http://www.w3.org/People/Raggett/tidy/.

And it's free!

Regards
Morten

-- 
×·.¸¸.·´¨)¸.·´  ¸.·´¨) OMorten Liebach [EMAIL PROTECTED]
(_¸.·´ (¸.·´  ¸.·× 0http://home1.stofanet.dk/liebach/
 (_¸.·´ohttp://pc89225.stofanet.dk/
   .

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