RE: Environment variables and Win32::ODBC

2002-11-07 Thread Daryl J. Hoyt
I think the line is supposed to be:
use Win32::ODBC;

Thanks,


Daryl J. Hoyt
Software Engineer
Geodesic Systems
 http://www.geodesic.com
 mailto:djh;geodesic.com




-Original Message-
From: Angel Iliev Kafazov [mailto:angel.kafazov;mail.bg]
Sent: Thursday, November 07, 2002 12:48 PM
To: '[EMAIL PROTECTED]'
Subject: Enviroment variables and Win32::ODBC


Hi,

I am trying to write a scipt which generates a web page based on a 
information is ACCESS database. First, I need another script which hava 
to pass the information (user ID) to the one which will actually display 
the other page. I have to pass the infprmation only by clicking on a 
particular link. The scrpt that generates the web page gives me the 
following error:


syntax error at franowner.pl.txt line 1, near use Win32:
Execution of franowner.pl.txt aborted due to compilation errors.


the script is:


use Win32:ODBC;


$ownerid = $ENV{'QUERY_STRING'};
$DSN=db1
$dbh = new Win32::ODBC($DSN);

$statement = SELECT Field1, Field2, Field3, 
Field4, Field5, Field6 FROM Owners WHERE ID=17;

if ($dbh-Sql($statement)) {
   print SQL failed.\n;
   print Error:  . $db-Error() . \n;
}


$sth = $dbh-prepare($statement);
$rv = $sth-execute || die Cannot execute SQL statement:\n$DBI:errstr\n;

($ownerfname,$ownerlname,$owneradd,$ownercity,$ownerst,$ownerzip) = $sth-
fetchrow_arrayref;





It also gives me SQL error when I try to select from columns which names 
are consisted of more than one word
__
12MB-POP3-WAP-SMS---TOBA-E-mail.bG
--

 Ako uckame u Bue agpec B mail.bg 
ugeme myk: http://www.mail.bg/new/ 

-- 
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: help with file reading

2002-10-07 Thread Daryl J. Hoyt

You can pass in a variable it would be something like this:

$lofile =  somefile;
file_read($lofile) ;

sub file_read($)
{
  my ($file) = @_;

  while ($file)

blah..blah..

}

Daryl J. Hoyt
Software Engineer
Geodesic Systems
312-832-2010
 http://www.geodesic.com
 mailto:[EMAIL PROTECTED]




-Original Message-
From: Pravesh Biyani [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 8:55 AM
To: [EMAIL PROTECTED]
Subject: help with file reading 


Hi
 can i pass the file variable in the function..

for eg.

$lofile =  somefile;

and call the function

 file_read(lofile) ;

where function is :


sub file_read
{

  while ($_[0])

blah..blah..

}



Pravesh





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




Is there a way to do cron on windows?

2002-08-20 Thread Daryl J. Hoyt

Hi all,
I am looking for a way to run something like a cron job on windows.  I
would like to check every 10 minutes to see if an application is running.
If it is not running, I would then like to launch it.  Is there a way to do
this in Perl (or any other way)?  Any help would be appreciated.

Thanks,

Daryl



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




RE: Shift

2002-07-16 Thread Daryl J. Hoyt

It returns the first value of an array and then increments the index.

Daryl J. Hoyt
Software Engineer
Geodesic Systems
312-832-2010
 http://www.geodesic.com
 mailto:[EMAIL PROTECTED]




-Original Message-
From: Adriano Sastre Vieira [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 11:54 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; Michael
A Chase; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Shift


What does the following instruction means? That is, when my variable
receives shift, what is it?

  my $MENUI = shift;

Thanks :-)
-
Adriano Sastre Vieira
Especialista em Sistemas
Inatel Competence Center
+55 35 3471 9335
http://www.inatel.br




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




getting a child process's pid

2002-07-09 Thread Daryl J. Hoyt

Hi,
I have a problem I can not seem to figure out.  I need run an executable
from a Perl script and I want it to return the PID for the executable.  I
looked at the docs for fork(), but if I did something like:
if($PID = fork)
{
system(foo.exe);
}
I think it would return the PID for the fork in the if statement and not the
one from the system call.  Is there any way to get the PID from the child?
Any help would be greatly appreciated.

Thanks,

Daryl



Regex Help

2002-07-08 Thread Daryl J. Hoyt

Hi,
I am trying to write a script to kill all processes named $string.  I am
not sure how to handle the regex the right way.  Here is a sample of the
command:

djh  17893 17892  0 Jul03 pts/16   00:00:00 rlogin test3
djh   6401 25628  0 Jul05 ?00:00:00 [rhn-applet defunct]
djh   6525 25746  0 Jul05 pts/100:00:00 bash
djh   6530  6525  0 Jul05 pts/100:00:00 rlogin xeon
djh   6531  6530  0 Jul05 pts/100:00:00 rlogin xeon
djh   6828 25746  0 Jul05 pts/900:00:00 bash
djh   6833  6828  0 Jul05 pts/900:00:00 rlogin xeon
djh   6834  6833  0 Jul05 pts/900:00:11 rlogin xeon
djh   7292 26480  0 Jul05 pts/10   00:00:00 rlogin spot
djh   7293  7292  0 Jul05 pts/10   00:00:00 rlogin spot
djh   7361 25746  0 Jul05 pts/12   00:00:00 bash
djh   7366  7361  0 Jul05 pts/12   00:00:00 rlogin spot
djh   7367  7366  0 Jul05 pts/12   00:00:00 rlogin spot
djh   7466 25746  0 Jul05 pts/14   00:00:00 bash
djh   1612 25628  0 08:49 ?00:00:00 [rhn-applet defunct]
djh   1639 25746  0 08:50 pts/17   00:00:00 bash
djh   1647  1639  0 08:51 pts/17   00:00:00 rlogin duke
djh   1648  1647  0 08:51 pts/17   00:00:00 rlogin duke
djh   1742 1  0 09:10 ?00:00:00 gvim process_killer.pl
djh   1778  7466  0 09:20 pts/14   00:00:00 /usr/local/bin/perl
../process_kidjh   1779  1778  0 09:20 pts/14   00:00:00 sh -c ps -ef |
grep djh
djh   1780  1779  0 09:20 pts/14   00:00:00 ps -ef
djh   1781  1779  0 09:20 pts/14   00:00:00 grep djh

I want to strip out the fist columns of numbers (the PIDs).  How would I do
this if each line of this is an element in an array?  Any help would be
appreciated.

Thanks






XML::XPath / XML::Parser problems on Windows (cygwin)

2002-05-22 Thread Daryl J. Hoyt

I'm having problems getting XPATH to install on Cygwin Windows.  I
downloaded Expat from souceforge, and installed it, but for some reason
XML::Parser can not find expat.h even though I supply the env vars
EXPATINCPATH=d:\XML\expat and
EXPATLIBPATH=d:\XML\expat\src\expat_win32bin_1_95_1 (I have tried both unix
and windows styles).  I have even copied the expat.h file into the directory
where it is supposed to be built.  Anyone have any ideas what else I can do?


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]







RE: question

2002-04-16 Thread Daryl J. Hoyt

If you need to call a function in another Perl script, you must require
that script in your program.  You can then call the desired function.  Make
sure the script you wand to require is in the same directory or you will
have to push its directory into the @INC array.  Here is an example.



#!/usr/local/bin/perl -w

push(@INC, /usr/home/aaa/);  # only needed if someScript.pl is not in the
@INC dir, which includes the local dir
require 'someScript.pl';

someScriptFunction;


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]



-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 9:11 AM
To: Tucker, Ernie
Cc: [EMAIL PROTECTED]
Subject: Re: question


On Tue, 2002-04-16 at 09:39, Tucker, Ernie wrote:
 How can a have one perl script call another perl script ?


 Ernest P. Tucker II
  Network Technician
  Charter Communications
  Madison Management Area
(608) 373-7625


That depends on what you mean by call.  If you want to run an external
script you can use system.  If you want to run an external script and
want to use the output in your program use the backquotes (@output =
`/usr/bin/command.pl`;).  However, if you mean that you want to call a
function in another script then you need to take a look at modules
(perldoc perlmod).

--
Today is Sweetmorn the 33rd day of Discord in the YOLD 3168


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




RE: Substitution: How do I say ...

2002-03-29 Thread Daryl J. Hoyt

s/\t454354/br/g;


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com 
mailto:[EMAIL PROTECTED] 



-Original Message-
From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 10:58 AM
To: [EMAIL PROTECTED]
Subject: Substitution: How do I say ...


 replace every \t (tab character) which is NOT immediately proceeded
by '454354' with 'br'?

Thanks. I suspect this is any easy one, but I've been staring at it for
an hour, and I can't figure it out. Brain not working well today.

-Kevin Zembower

-
E. Kevin Zembower
Unix Administrator
Johns Hopkins University/Center for Communications Programs
111 Market Place, Suite 310
Baltimore, MD  21202
410-659-6139

-- 
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: Substitution: How do I say ...

2002-03-29 Thread Daryl J. Hoyt

That's what I get for not reading to carefully ;-).  The proper command is
s/\t(?!454354)/br/g;.  Sorry about that.


-Original Message-
From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 11:38 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Substitution: How do I say ...


Hi, Daryl, thanks for writing.

Wouldn't this substitute for tabs which DO have a 454354 after them? I
was asking how to sub for tabs which do NOT.


-Kevin

 Daryl J. Hoyt [EMAIL PROTECTED] 03/29/02 12:32PM 
s/\t454354/br/g;


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]



-Original Message-
From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 10:58 AM
To: [EMAIL PROTECTED]
Subject: Substitution: How do I say ...


. replace every \t (tab character) which is NOT immediately
proceeded
by '454354' with 'br'?

Thanks. I suspect this is any easy one, but I've been staring at it
for
an hour, and I can't figure it out. Brain not working well today.

-Kevin Zembower

-
E. Kevin Zembower
Unix Administrator
Johns Hopkins University/Center for Communications Programs
111 Market Place, Suite 310
Baltimore, MD  21202
410-659-6139

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



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




RE: Reg Exp help

2002-02-26 Thread Daryl J. Hoyt

If there is only one of the lines |GRP| this will work. Otherwise I would
push the lines into a an array instead of a variable.

@Out = `$Cmd`;
$WhatFollowsGRP = ;

foreach my $line (@Out)
{
if($line =~ /|GRP|/)
{
$line =~ s/|GRP|//;
$WhatFollowsGRP = $line;
}# end if
}# end foreach loop

Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]



-Original Message-
From: Busse, Rich [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 26, 2002 8:35 AM
To: Perl Beginners
Subject: Reg Exp help


I am capturing the output of a command in a string:

$Out = `$Cmd` ;

The output always looks like:

List of Templates and Template Groups assigned to 'somenode.us.dnb.com':

|GRP| SBS-DSM

Operation successfully completed.

It's always on 5 separate lines. How do I extract what follows |GRP| on the
third line to a variable? TIA...

--
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: What's this error?

2002-01-14 Thread Daryl J. Hoyt

Try $::root.  Or if you're using a package (like package bob), use
$bob::root.


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]



-Original Message-
From: Scott Taylor [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 10:18 AM
To: [EMAIL PROTECTED]
Subject: Re: What's this error?


At 01:39 AM 01/14/02, louie miranda wrote:
Hi, i was hoping for some assistance. Could some one tell me what does this
error
means?

###
Global symbol $root requires explicit package name at
/usr/perl5/5.00503/i86pc-solaris/CS/Config.pm line 44.
Compilation failed in require at /usr/sbin/checkservice line 23.
BEGIN failed--compilation aborted at /usr/sbin/checkservice line 23.
###

Probably has to do with an error in your source code.  Without seeing the
source code it would be a guess.  I would guess you need to declare your
variable $root.



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




Is there a way to rsh (or remsh) in Perl?

2002-01-04 Thread Daryl J. Hoyt

I have several scripts that I would like to get data from several machines.
I have seen the ssl and telnet modules, but is there one for rsh.  It has
been recommended to me that rsh would be a better approach.

Regards,


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]







RE: Is there a way to rsh (or remsh) in Perl?

2002-01-04 Thread Daryl J. Hoyt

I had checked out cpan.org, but it appeared that the only one listed there
was configuring the Linux kernel packet filtering firewall.  It doesn't
appear to allow rsh from inside of a Perl script.

ex.

if($PE::Host ne duke)
{
rsh duke;
continue script...
}

Thanks in advance


-Original Message-
From: KeN ClarK [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 9:16 AM
To: Daryl J. Hoyt
Cc: Beginners Perl; Perl-Unix-Users
Subject: Re: Is there a way to rsh (or remsh) in Perl?


search.cpan.org. it's wonderful.


http://search.cpan.org/search?mode=modulequery=rsh

ken

On Fri, 4 Jan 2002, Daryl J. Hoyt wrote:

 I have several scripts that I would like to get data from several
machines.
 I have seen the ssl and telnet modules, but is there one for rsh.  It has
 been recommended to me that rsh would be a better approach.

 Regards,


 Daryl J. Hoyt
 Performance Engineer
 Geodesic Systems
 312-832-2010
 http://www.geodesic.com
 mailto:[EMAIL PROTECTED]






KeN
_
http://quantifier.org GnuPG: 7C828670
 10:15am  up 1 day,  2:19
Asleep at the switch!  I wasn't asleep!  I was drunk!

-- Homer Simpson
   Homer The Vigilante



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




REGEXP Help on Linux

2002-01-04 Thread Daryl J. Hoyt

Hi,
I am trying to use the net::telnet module, and I keep timing out.  I
believe it is because I do not have the right prompt.  My prompt looks like
[sqa1@duke:~]$.  I do not know why this doesn't work: Prompt =
'/\[$::username\@$::machine\]\$$/'.  Any help you can give me would be
greatly appreciated.


Thanks,

Daryl J. Hoyt




#!/usr/local/bin/perl -w
use strict;

use Net::Telnet ();

$::command = p4 sync -f \$HOME/p4/eng/sqa/tools/...;
$::username = sqa1;
$::passwd = ***;
$::machine = sparky;

$::t = new Net::Telnet (Timeout = 30, Prompt =
'/\[$::username\@$::machine\]\$$/');
$::t-open($::machine);
$::t-login($::username, $::passwd);
#@::lines = $::t-cmd(p4 sync -f
//info.geodesic.com/eng/pe/tools/bin/...);
$::t-cmd($::command);
@::lines = $::t-cmd($::command);

print @::lines\n;
print \n;




RE: I need your help

2001-12-28 Thread Daryl J. Hoyt

How about:

if($string eq $name)
{
$string = #.$string;
}


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com 
mailto:[EMAIL PROTECTED] 



-Original Message-
From: Jose Vicente [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 7:27 PM
To: [EMAIL PROTECTED]
Subject: I need your help


Hi friends.
I am replacing a string using s///, in the following way:, but I only
need and exact string to be replaced, for example if I have a file with the
following strins:
amor
alto
a
bacho
And execute
~s/$name/#$name/g

where $name is equal to a, so I have

#amor
#alto
#a
b#acho

But I want
amor
alto
#a
bacho

Please help me. Because I need.
Bye and have a good year.






-- 
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: Good CS Literature

2001-12-27 Thread Daryl J. Hoyt

CS is a good field.  There are many different approaches universities take
to the study of computer science, so it is difficult to recommend specific
books.  I recommend learning one language really well.  C/C++ is a good
start.  C is fundamental to any good CS degree.  C++ will also give you the
object-oriented approach you will need in the real world.  If you would like
to start with an easier language Perl is great.  Listed below are a number
of books I would recommend.
If your university is using either Linux or Unix (system V), I highly
recommend the OS book listed below.  It gives you complete source code for a
working multi-threaded OS with lots and lots of comments.  Even if you are
using Windows, this would be a good book ;-.

The C Programming Language Kernighan and Ritchie
The C++ Programming Language Special Edition Bjarne Stroustrup
Perl Cookbook Christiansen and Torkinton (O'Reilly Press)
Operating System Design  Douglas Comer and Timothy V. Fossum


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]



-Original Message-
From: Luke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 27, 2001 2:32 AM
To: [EMAIL PROTECTED]
Subject: Good CS Literature


Hello people... Happy Holidays...

  This is my first post.  Im a senior high school student and
about to graduate this year(lets just hope hehhehe).. Im just
wondering if any of you can recommend some good Computer Science
books that most universities use...my programming skills is a
little scattered (C,Java, Perl, Python..)[ALL basic stuff]but i
still dont consider myself a programmer...



thnx

luke






--
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: Global Symbols

2001-12-19 Thread Daryl J. Hoyt

Try $::whatever.  It may be using strict -w.


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com
mailto:[EMAIL PROTECTED]



-Original Message-
From: Chris Zampese [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 9:38 AM
To: [EMAIL PROTECTED]
Subject: Global Symbols


Hi everyone,
I am running a perl script through an Apache server, and the error log is
showing

  Global symbol  $whatever requires explicit package name
for all my variables (Globals and locals),

  any ideas,
Thanks in advance,
 Chris.


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




RE: Using die but not break out of the script

2001-12-07 Thread Daryl J. Hoyt

You could use:
system (dir $servervolume  dirinfo) || ($var = 0);


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
312-832-2010
http://www.geodesic.com 
mailto:[EMAIL PROTECTED] 



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, December 07, 2001 1:38 PM
To: [EMAIL PROTECTED]
Subject: Using die but not break out of the script


Is there a way to use die but not break the entire script?

system (dir $servervolume  dirinfo) || die cant get dir info;

I want it that if does die to assign a value of zero to a variable?  Is
that posssible?

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]




Number of processors on a *nix system

2001-08-27 Thread Daryl J. Hoyt

Hi,
I am looking for a way for Perl to determine how many processors are on a
system.  I know in Windows, I can use the NUMBER_OF_PROCESSORS environment
variable, but *nix doesn't have this.  Any Ideas???

Thanks,


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
http://www.geodesic.com
[EMAIL PROTECTED]



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




RE: Perl is amazing!!

2001-08-23 Thread Daryl J. Hoyt

This link takes you to a great beginner's page.  I find it very useful and
still reference it occasionally.

http://www.cs.unm.edu/~bwylie/perl/start.html

-Original Message-
From: Randy5235 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 7:18 AM
To: [EMAIL PROTECTED]
Subject: Perl is amazing!!


I just started learning Perl about 2 days ago. I am totally blown away at
the power and ease. I am however trying to find as much reference as
possible. I have checked most of the popular sites thus far and managed to
find some docs there. Any links to documentation and how to's for a beginner
would be much appreciated. Thanks Randy5235



--
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: is this sub called correctly? am I missing something?

2001-08-23 Thread Daryl J. Hoyt

I do not believe that you need the  before the function call.

-Original Message-
From: Birgit Kellner [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 23, 2001 12:52 PM
To: [EMAIL PROTECTED]
Subject: is this sub called correctly? am I missing something?


I have a sub called and it doesn't return what it's supposed to return - am
I blind or is there something I am missing out on?
The script runs with use strict, and no errors are reported.

my ($db_key, %rec);
# %orderhash contains numeric keys and values, like ('43' = '5', '20' =
'17'); I want to call the sub get_record for each of these keys.
# NOTE: this works perfectly, with the same syntax, in other parts of the
same file.
# might the problem be that I'm embedding the call to the sub in a foreach
loop here?

foreach (keys %orderhash) {
$db_key = $_;
print Database key: $db_key; #this works fine, so $db_key HAS a 
numeric
value
%rec = get_record($db_key); # here's the problem: %rec doesn't get
returned
print Number: $rec{'number'}; # ouch, no value.
}

# this is the called sub, contained in another file that we're requiring.
# other file also runs under use strict - no errors reported. all variables
not declared in the sub are declared globally.
# I won't give all explanations about what this does just yet - hoping that
this is a simple logic error which I'm too blind to see ...

sub get_record {
# 
# Given an ID as input, get_record returns a hash of the
# requested record or undefined if not found.

my ($key, $found, $line, @data, $field, $restricted, $i, %rec);
$key = $_[0];
$found = 0;
($restricted = 1) if ($auth_modify_own and !$per_admin);

open (DB, $db_file_name) or cgierr(error in get_records. unable to
open db file: $db_file_name.\nReason: $!);
if ($db_use_flock) { flock(DB, 1); }
LINE: while (DB) {
(/^#/)  and next LINE;
(/^\s*$/)   and next LINE;
$line = $_; chomp ($line);
@data = split_decode($line);
next LINE if ($restricted and ($db_userid ne $data[$auth_user_field]));
if ($data[$db_key_pos] eq $key) {
$found = 1;
for ($i = 0; $i = $#db_cols; $i++) {  # Map the array columns 
to a hash.
$rec{$db_cols[$i]} = $data[$i];
}
last LINE;
}
}
close DB;
$found ?
(return %rec) :
(return undef);
}

I'd be really grateful for any hints as to what might be wrong - thanks in
advance.
I've also tried calling the sub without , but it doesn't make a
difference.

Birgit Kellner

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




I'm looking for a program to make a Perl Script into a Windows .EXE

2001-07-19 Thread Daryl J. Hoyt

Hi,
I'm looking for a program that can make a windows executable out of a Perl
script.  The exe would then be run on computers that do not have Perl
installed on them.  Does anyone have any suggestions or recommendations?

Thanks,


Daryl J. Hoyt
Performance Engineer
Geodesic Systems
http://www.geodesic.com
[EMAIL PROTECTED]



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




RE: Ok brain fart here...

2001-07-18 Thread Daryl J. Hoyt

What are the errors?  It works fine here.


-Original Message-
From: Richie Crews [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 10:27 AM
To: [EMAIL PROTECTED]
Subject: Ok brain fart here...


Ok I am beating my head why this is not working...
 
$fname = STDIN;
chomp $fname;
$fletter = substr($fname,0,1);
# now we have the first letter of the first name
if ( $fletter =~ /[a-f]/i) {
print First letter is a-f\n;
}
 
 
You get the picture I would have other if's based on the first letter
however my regex is not working any idea I just need another prospective on
it.
 
Richie Crews
Unix Systems Administrator
 
(706) 773 - 3436 CELL
(706) 634 - 3681 DESK
(706) 634 - 3831 FAX
 
~
Disclaimer: Any errors in spelling, tact, or fact are transmission errors
and not the fault of the sender.
~
 


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




RE: Re: Editor

2001-07-06 Thread Daryl J. Hoyt

I use vi only when nothing else is available. ;-

-Original Message-
From: anton [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 8:08 AM
To: [EMAIL PROTECTED]
Subject: Re: Re: Editor


I've listen to you all about the editors problem
Is anybody out there still using the old bottom-dweller vi ?

On Fri, 06 Jul 2001 14:48:53 +0200, Matija Papec [EMAIL PROTECTED]
wrote:
 Aigner-Torres, Mario [EMAIL PROTECTED] wrote:
 Hi Bill,
 
 my choice is gnuemacs

 Does it support script debugging? I'm looking for nice *nix editor
 /debugger with breakpoints, step execution, etc. Have you tried
 PerlComposer?

 with cperl!

 What is cperl?



 --
 Matija