I've got a file for which I use 'stat' to acquire its information, but
stat gives you numeric uid and gids. I need to get to the actual
username and groupname. How can this be done?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I am parsing some XML and trying to write the tags to a table. Here is
the table (PostgreSQL):
Column | Type | Modifiers
---+-+---
id| integer |
ref_id| text|
ref_table | text|
tag | text|
seq | integer |
Here is the code where I
Nevermind. Got it figured out. Turns out I had a bad environment
variable that was trying to insert into a parallel DB in which the
ref_id field was defined as 'integer' instead of 'text'.
Ben Siders wrote:
I am parsing some XML and trying to write the tags to a table. Here
is the table
I installed OpenBSD's Apache but the default configuration is that httpd
runs chroot'd to /var/www for security. This is fine, except that for
the life of me, I cannot get my Perl CGI scripts to run. I've tried
linking /usr/bin/perl into /var/www but that doesn't work because of the
chroot,
John Baker wrote:
On Mon, 27 Jan 2003, Ben Siders wrote:
Date: Mon, 27 Jan 2003 08:48:58 -0600
From: Ben Siders [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Perl in OpenBSD Apache
I installed OpenBSD's Apache but the default configuration is that httpd
runs chroot'd to /var/www
This is correct. When you include something the last line has to return
a true value, so people often stick a 1; at the end. Consider it a bit
of plumbing that a module or library just has to have.
Dan Muey wrote:
At the end of a lib file ( in the script you have require lib.lib; and lib.lib
OK apparantly I have a scoping problem below. If I add this line:
print ok\n if exists $db_table-{codeline};
inside my function, I get nothing. If I put it right after the db_table
declaration, it prints. So... are 'my' variables outside of a function
not visible inside it?
Ben Siders
Yes. DBI has support for PostgreSQL. You can perform almost any
transaction through it that you would at the command line.
Gerardo wrote:
i want to know if i can to run perl with the dbi module and to view a
Progress database.
... and sorry ... my english is very bad.
thanks.
--
Ah, I skimmed over it too fast. My bad.
Bob Showalter wrote:
Ben Siders wrote:
Yes. DBI has support for PostgreSQL. You can perform almost any
transaction through it that you would at the command line.
Gerardo wrote:
i want to know if i can to run perl with the dbi module
You'll be waiting a long time. Perl quickly moves into scientific
notation and can handle arbitrarily large values. I wrote a similar
program a while back and got bored with it when the count hit about
10^17. :)
Christopher D. Lewis wrote:
Someone posted a question as to the size of number
You should always perform all error checking in any language to ensure
that your program, if it fails, declines gracefully. One of the
greatest shortcomings of C is that error checking is entirely manual,
and you simply must, in every real-world application, check the return
value of almost
strftime is an interface to a C function of the same name. It's a
fairly common function in many applications that have to deal with dates
and times. You may not need it here, but it's not a bad idea to get a
little familiar with it. For the life of me, I can't ever remember all
the format
Play around with *FILEHANDLE. For example:
open FILEHANDLE, blah.txt;
closeFile( *FILEHANDLE );
sub closeFile {
my $fh = shift;
print $fh I closed you.\n;
close $fh;
}
Mkrous wrote:
Cheers Joseph,
thanks for your reply.
Still it does not work,
$FileHandle is set to the
I suspect we're being baited, but I'll bite. Write this as a normal
Perl program:
#!/usr/bin/perl
$_=7P0374;;
tr[0-][ LEOR!AUBGNSTY];
print;
It's setting the default variable to that goofball string and then
translating the characters. If you process through the translation, you
get a rude
Since it's commented out, it could be that somebody removed that
function in previous maintenance.
Jenda Krynicky wrote:
From: Johnson, Shaunn [EMAIL PROTECTED]
I am not familiar with using 'if' in a script and I have
come across a list of new scripts that I now
have to learn / maintain. In
Are there any CPAN modules that can analyze XML or HTML and report any
cases of unclosed tags? For example:
note
subjectHello, world/subject
authorMe/author
contentHey, is thing boldthing on?/content
/note
In the above, I'd like to find a method of detecting that the bold tag
is
My Perl libary consists of Learning Perl, Programming Perl, The Perl
Cookbook, Advanced Perl Programming, and I just ordered the DBI book.
Most people probably don't need all those, and I probably wouldn't have
them all if I hadn't received most of them during some professional
training
I generally like the O'Reilly Perl books, and I've had good luck with
them. I can't use them as my only Perl reference, though. I don't pick
up the condescending tone in them that you seem to have, but I
definately agree that they're overrated. The Perl books, in general,
are excellent, but
The quest for an email validation script is becoming ancient and
legendary. I'm sure somebody else already has sounded off on this, but
the short answer is that there's no sure-way to validate email. There's
any number of potential problems:
1. The email address does not conform to the RFC
Use two $$.
if ( $line =~ /$$myVariable/ ) {
doSomethingSpiffy;
}
Dan Muey wrote:
If I do that won't it look for the 'value' of $variable?
I need it to find the actual string '$variable' not what $variable contains.
Any other ideas?
-Original Message-
From: Paul Johnson
.
[bsiders@lysol perl]$ ./test.pl
blorg
1. Line contains my variable.
2. Line contains by variable.
Ben Siders wrote:
Use two $$.
if ( $line =~ /$$myVariable/ ) {
doSomethingSpiffy;
}
Dan Muey wrote:
If I do that won't it look for the 'value' of $variable?
I need it to find the actual
I believe that what he's after is a RE that will match the name of a
variable proceded by a dollar sign.
I.E., given this:
$foo = bar;
if ( $var =~ /some RE here/ ) { print true }
He wants the expression to evaluate true if $var contains the string
$foo; that is, the character '$' followed
I have a subroutine that will receive parameters as follows:
key1, value1, key2, value2, key3, value3, ... keyN, valueN
I want to create a hash of key1 = value1, key2 = value2, ... , keyN =
valueN in the subroutine. I'm curious if there's a Perl trick to
doing this beyond the obvious looping
This is perfect. The input is coming from a CPAN module so I'm fairly
confident that the number of entries will be even, but checking is
always a good idea.
You may want to check first that the list has an even number of entries:
die Invalid parameters if @_ % 2;
but after that it's just:
I'm not 100% confident that'll work as written. I *think* that if the
open is successful then the die will never execute and that 'if' will
never get checked. If the 'open' is successful on writing to a
non-existant file, I'm not sure if this solution will correct it.
Dan Muey wrote:
Open
If not for the need for attachments, I'd suggest using the 'mail' shell
command via the ` ` operator. I don't know how to attach files using
'mail', for all I know it may not even be possible. This may be a
stupid question, but have you looked at the modules on CPAN yet?
Paul Kraus wrote:
26 matches
Mail list logo