Perl Newbie Question

2004-05-18 Thread Perl Mail User
Hello All,

I have a question, I am looking to read the name of the file that I am 
passing as an argument to the perl script through the while (<>) part of
the script.  

Example: perl script.pl 1.txt 2.txt 3.txt
Each file has information that I am parsing to put into a report but I need
to get the name of the file that I parsed and print that information as well,
so that way I know what values I am getting from each file associates with 
what file.  

So the output would look like

1.txt   (parsed information)
2.txt   (parsed information)
3.txt   (parsed information)

Any assistance would be great.
Thanks

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




Assistance with Parsing Code

2004-03-19 Thread Perl Mail User
Hello All,

I have a question - I am new to perl and I would like to
parse a file that I have and gather some data from that
for use.  What I am looking to do is to search the file 
for a set of { } once I reach that set of { } I want to
parse the data in the brackets.

Example:

Device Capacity
{
Cylinders:  18590
Tracks   : 278850
512-byte Blocks  :   17846400
MegaBytes:   8714
KiloBytes:8923200
}

Each set of brackets, { }, has its unique title or header as 
show above.  I want to find the unique title and then parse 
the data within the { } and then move on to the next unique
header / title and do the same thing.  So from the above I 
would like to find "Device Capacity" and then within the { }
assign each sub catagory its appropriate value.

So what I think that I would do is to create a HoH.  But the
question is how do I ensure that I only grab the data within 
the brackets.

What the HoH would look like is this, if I am correct:

DeviceCapacity{Cylinders}   = 18590
DeviceCapacity{Tracks}  = 278850
DeviceCapacity{512-byteBlock}   = 278850
DeviceCapacity{MegaBytes}   = 8714
DeviceCapacity{KiloBytes}   = 8714

So I just need some assistance on how to parse the data from within
the brackets and assign that data to the HoH.

TIA
Perl Beginner(Bryan)

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




Newbie that needs some help

2004-02-21 Thread Perl Mail User
Hello All,

I have a basic question, I am new to perl, and I would like to try 
and get a basic question answered, if possible.  I have a file with 
about 63 lines in it, I am running it through a basic perl program
that reads every line and prints it to the screen.  I am trying to 
get the output of each line into an @array, but all I am getting is
the last line in the file. Any help would be great.

Script  Like I said it is basic.

__begin__

#!/usr/bin/perl

open(FILE, "file1.txt") || die "Can not open file.  $! \n";
while ($line = ) {
if ($line =~ /:58/) {
  #print $line; ## For Debugging Only
foreach ($line) {
@lines = $line;
}
}
}
print "@lines";

__end__

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




perl question

2004-01-10 Thread Perl Mail User
Hello all Perl Gurus - 

I have a question in regards to an error i receive from running a script in perl from 
a user on my 
system - the error is below - I do not get this error when I run it as root just as a 
user that 
needs to run this program.  

Any Ideas.

~~ error ~

Time::HiRes object version 1.38 does not match $Time::HiRes::XS_VERSION 1.54 at 
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 249.
Compilation failed in require at /usr/lib/perl5/5.8.0/Razor2/Logger.pm line 7.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/Razor2/Logger.pm line 7.
Compilation failed in require at (eval 7) line 3.
...propagated at /usr/lib/perl5/5.8.0/base.pm line 64.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/Razor2/Client/Core.pm line 
23.
Compilation failed in require at (eval 3) line 3.
...propagated at /usr/lib/perl5/5.8.0/base.pm line 64.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.0/Razor2/Client/Agent.pm line 
18.
Compilation failed in require at /usr/bin/razor-report line 21.
BEGIN failed--compilation aborted at /usr/bin/razor-report line 21.

Spam Administrator(Bryan)

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




Which DBD -Module do I need??

2001-05-31 Thread perl . mail

Hello,

i will connect from Unix ( Client HP -UX OS) to a Microsoft SQL 7.0 database
(SQL-Server Windows NT OS).
I have installed the DBI Module, but I don' t know, which DBD - Module I am
installing
additionally??

Best Regards

Hasan

-- 
Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




APACHE with MOD_PERL

2001-05-23 Thread perl . mail

Hello,

I will install apache_1.3.20.tar.gz and mod_perl-1.25.tar.gz on the HP-UX
OS.
I have installed all perl modules e.g

libwww-perl-5.48.tar.gz
URI
MIME-Base64
HTML-Parser
libnet
Digest::MD5
HTML::Tagset 

Finally I am doing following:

$gzip -d apache_x.xx.tar.gz
$tar xfv apache_x.xx.tar
$gzip -d mod_perl-x.xx.tar.gz
$tar xfv mod_perl-x.xx.tar

$cd mod_perl-x.xx
$perl Makefile.PL EVERYTHING=1
$make
$make test
$make install   

$cd apache_x.xx
$CC=cc CFLAGS=-Ae ./configure --prefix=/usr/local/apache
$make
$make install

The "make test" doesn' t execute correct. I get the message

cp t/conf/mod_perl_srm.conf t/conf/srm.conf
/usr/local/software/apache_1.3.20/src/httpd -f
`pwd`/t/conf/httpd.conf -X -d `pwd`/t &
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...Syntax error on line 3 of
/usr/local/software/mod_perl-1.25/t/conf/httpd.conf:
Invalid command '=pod', perhaps mis-spelled or defined by a module not
included in the server configuration
done
/usr/bin/perl t/TEST 0
still waiting for server to warm up...not ok
server failed to start! (please examine t/logs/error_log) at t/TEST line 95.
*** Error exit code 9

Stop.

Thanks a lot for you help

Best Regards

Hasan

-- 
Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




Version from Apache

2001-05-21 Thread perl . mail

Hello 

How I get the version from apache??

Thanks a lot

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




ODBC Driver for UNIXPLATFORM HP-UX 10.20

2001-05-17 Thread perl . mail

Hello,

I need an ODBC driver for the OS HP-UX 10.20 ( Unixplatform )
Where I can download this driver, and what I am doing to install this
driver?

Thanks a lot

Hasan Ügür

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net




Apache

2001-05-09 Thread perl . mail

Hello,

I installed a webserver "Apache" on my Workstation, the OS is Windows NT4.0
and have a Perl version
5.0.3

My problem is, that I can not execute CGI - SCRIPTS.

I get the error message:

Forbidden
You don't have permission to access /cgi-bin/1st-cgi.pl on this server.

Apache/1.3.12 Server at fn0676.zff.zf-group.de Port 3000

I edit the http.conf file, you can see it:



Thank´s a lot..

Hasan

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://www.apache.org/docs/> for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# After this file is processed, the server will look for and process
# C:/Programme/Apache Group/Apache/conf/srm.conf and then C:/Programme/Apache 
Group/Apache/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "/usr/local/apache" will be interpreted by the
# server as "/usr/local/apache/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "C:/Programme/Apache Group/Apache"

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know because
# this file will be  created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_status

#
# In the standard configuration, the server will process httpd.conf,
# srm.conf, and access.conf in that order.  The latter two files are
# now distributed empty, as it is recommended that all directives
# be kept in a single file for simplicity.  The commented-out values
# below are the built-in defaults.  You can have the server ignore
# these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive OFF

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We reccomend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Apache on Win32 always creates one child process to handle requests.  If it
# d