Hi,
I need to communicate with remote device through UDP protocol, this is
my problem:
If I send number to port UDP XY of remote device (number must be 2-bytes
long), remote device will send me back this data structure:
(Pascal-like)
TS_QUE_TYPE = Packed Record
tsqQueId : Word;
tsqStatus
When you look at the following Perl program which probes a NT domain for
servers using Win32::NetAdmin::GetServers, and runs
Win32::AdminMisc::GetDriveSpace( $UNCPath ) to retrieve disk utilization,
how do you see the data getting written to $my_dir/DiskSpace.txt found in
the subroutine show_it
Jim Lundeen [EMAIL PROTECTED] wrote:
I have 2 scripts. One accepts 3 values LOGIN_USERNAME, LOGIN_PASSWORD
and ACTION from an HTML form. That script looks in a user table in
MySQL to verify the user. If valid, it passes them to MENU.CGI with
LOGIN_USERNAME and a unique session number
On Mon, 29 Jul 2002 20:06:09 -0400, [EMAIL PROTECTED] (Jim Lundeen)
wrote:
Here's the question: How to I post the LOGIN_USERNAME and USN to the
MENU.CGI script? I don't want the user carrying the info around in
the Location bar as ?USN=1234LOGIN_USERNAME=somebody -- I want it
to be part of the
Hello everyone,
I want to be able to pass some variables from the page to a recommend it
script, so I made a few adjustments like the following:
use CGI;
$q = new CGI;
# $MAXNUM=5;
$MAXNUM = $q-param('MAXNUM');
So, I pass the number of referrals from the URL, like:
A
Jim == Jim Lundeen [EMAIL PROTECTED] writes:
Jim Ok, perhaps not the most eloquent of methods, but here's what I
Jim did (putting my little knowledge of JavaScript to use!)...
If the answer is javascript, you're not done yet. Many corporate
firewalls filter javascript. Many individual users
I can't get this HTTP_EQUIV meta tag to print. I am following the syntax right out of
the man pages:
print $query-start_html( -head = meta({ -http_equiv = refresh, -content =
$refresh } ) );
And I get:
Content-type: text/html
Software error:
Undefined subroutine main::meta called at
Hi all,
I want to print a zip file to the browser but I want to make the browser
think that it gets the zip file directly, not through a CGI script.
Why?
Because when clicking on a link for downloading a zip file directly, the
download managers are triggered, and the page visitors can download
-Original Message-
From: John Pitchko [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 12:59 PM
To:
Subject: HTTP_EQUIV Meta Tag
I can't get this HTTP_EQUIV meta tag to print. I am following
the syntax right out of the man pages:
print $query-start_html( -head =
-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 1:13 PM
To: [EMAIL PROTECTED]
Subject: HTTP headers
Hi all,
I want to print a zip file to the browser but I want to make
the browser
think that it gets the zip file directly,
What is the best way to validate form data. I have a form which the user
enters dates like '08/01/2002'. What is the best way to make sure this
format is entered. Should i use javascript here or regex?
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
--- Kipp, James [EMAIL PROTECTED] wrote:
What is the best way to validate form data. I have a form which the user
enters dates like '08/01/2002'. What is the best way to make sure this
format is entered. Should i use javascript here or regex?
Thanks
Answering what I think you're asking:
Answering what I think you're asking: Client-side validation
(javascript) is fine for avoiding an
unnecessary trip to the server, but it's easily avoided --
you can just turn javascript off.
Therefore, server-side validation is mandatory lest you open
up security holes.
thanks.
My suspicion is that IE is looking ahead of time at the extension of the
file requested and doing some guess work (*I could be wrong*) but in
this case your only real option would be to rename your CGI script,
which is a beautiful thing about the web/unix/etc, you can do this!
You might try
my $num = 100; # or whatever integer;
$num = reverse($num);
$num =~ s/(\d{3})/$1,/g;
chop $num if $num =~ /,$/;
$num = reverse($num);
print $num;
I have this script to make an integer with comma at every 3 digits, from right to left.
(What should this presentation way name actaully ?? )
In Excel, there is an interesting function which can sort a table
by fields with any order and hierarchy order.
Is there any module can do this for whatever array of array,
hash of array... etc. ?
But what I am looking for is not for and related to any database.
So some of DBI functions maybe
Connie -
Try this (not really much better) from Perl Cookbook #2.17:
use strict;
use warnings;
my $num = commify (1_000_000);
print $num\n;
sub commify
{
my $text = reverse $_[0];
$text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
return scalar reverse ($text);
}
Aloha
Hello,
I wrote a big skript which uses net::ping (ping.pm) (and tk).
I noticed that the resultes of Net::Ping are not identical to the system
commad ping.
Much more Items are not reachable over Net::Ping then they are over the
system command.
I can´t explain why. (Even after rewriting 500 lines
T?mas gu?mundsson [EMAIL PROTECTED] wrote:
I need help ( you figure ?)
#!/usr/bin/perl
use strict;
use Cwd;
my $phone_book = qw{
^
THat should be '@phone_book' (or '%phone_book', really.)
A list-in-scalar-context (my $var = qw/foo bar/;) evaluates to
the last element of the
On Tue, 30 Jul 2002, Angerstein wrote:
Hello,
I wrote a big skript which uses net::ping (ping.pm) (and tk).
I noticed that the resultes of Net::Ping are not identical to the system
commad ping.
Much more Items are not reachable over Net::Ping then they are over the
system command.
The
the outputs of a program can be to STDOUT or STDERR ( and also to files
it opens internally )
On unix like systems
STDOUT is known by 1
STDERR by 2
The output of a program on STDOUT goes wherever 1 is directed to
similarly for STDERR 2
If U want to redirect STDERR to STDOUT use 21
eg.
On Mon, 29 Jul 2002, Ning luo wrote:
Hi Sir
I have a perl script using system function, like
system(perl goup 1basicName.scan 2basicName.err);
goup is another perl script, what I want to do is executing goup, then print
the results to the file basicName.scan, if it abort
Kevin Zembower [EMAIL PROTECTED] wrote:
I'm facing what I believe to one of the classic text manipulation
problems, transforming a document which was typed with a hard return
at the end of every physical line, and two consecutive newlines to
mark the end of a paragraph.
Would anyone help
Hello Jeff,
In fact, As you seen .. I'm newbie in Perl (in english too !)
I'm just trying to translate a korn-shell script to perl-script for learning
I try to use hashes like structs in C language, is it possible ?
I search an easy way like: declare a struct an put it's reference in an
This works for me
http://search.cpan.org/doc/WRW/Number-Format-1.44/Format.pm
use strict;
use warnings;
use Number::Format qw(:subs :vars);
$THOUSANDS_SEP = '.';
$DECIMAL_POINT = ',';
my @number = (123456789,123);
foreach my $number (@number) {
print format_number($number) . \n;
}
use
on Tue, 30 Jul 2002 10:51:56 GMT, [EMAIL PROTECTED] (Jean
Berthold) wrote:
In my case :
my @array ;
my $counter = 0 ;
# how to declare the prototype for the record used below ???
my $record = { FS, SNAP_PATH, TAPE_POS } ; # don't function ...
There is no need to declare a prototype. If
On Tue, 30 Jul 2002, Jean Berthold wrote:
my @array ;
my $counter = 0 ;
# how to declare the prototype for the record used below ???
my $record = { FS, SNAP_PATH, TAPE_POS } ; # don't function ...
You don't have to declare the keys of a hash beforehand.
When you say
my $record = {
Steve Grazzini wrote:
Kevin Zembower [EMAIL PROTECTED] wrote:
I'm facing what I believe to one of the classic text manipulation
problems, transforming a document which was typed with a hard return
at the end of every physical line, and two consecutive newlines to
mark the end of a
Here's a thought: You can convert the Excel spreadsheet to a .csv file and
then use DBD::CSV to sort the fields. You should be able to do this using
Win32::OLE as long as you run it on a system with Excel installed. The
macro code fro saving the file to a .csv is:
ActiveWorkbook.SaveAs
On Jul 30, Tómas Guðmundsson said:
my $phone_book = qw{
Fred 0123
John 4567
Bill 8901
};
If you had warnings on, you'd see that this wasn't doing very much.
my $selection = 1;
do {
print \n Please select one choice;
print \n 1. Enter name.;
print \n 2. Quit.\n;
chomp(my $selection
I think you need to take a look at perdoc dbi. try breaking the script down
into sections. first try just connecting to your datasource and see if that
produces any errors, then proceed with the next section.
also take a look at the docs for the execute(). you don't need to assign the
execute()
Hello all, i am parsing a cisco log and i can'nt find the exact
regexp,following goes the log and the script..
Jul 25 10:39:12 10.0.0.1 852: 1d23h: %VOIPAAA-5-VOIP_CALL_HISTORY:
CallLegType 2, ConnectionId 0 0 0 0, SetupTime *10:46:49.143 GMT Thu Jul
25 2002, PeerAddress 0051122323223,
On Tue, 30 Jul 2002, drieux wrote:
On Tuesday, July 30, 2002, at 01:31 , Sudarshan Raghavan wrote:
[..]
The system ping command sends ICMP echo packets and by default Net::Ping
sends udp packets. This will work only if the machine you are pinging
supports udp echo requests. For
Jul 25 10:39:12 10.0.0.1 852: 1d23h: %VOIPAAA-5-VOIP_CALL_HISTORY:
CallLegType 2, ConnectionId 0 0 0 0, SetupTime *10:46:49.143 GMT Thu Jul
25 2002, PeerAddress 0051122323223, PeerSubAddress , DisconnectCause 0
, DisconnectText , ConnectTime *10:47:09.753 GMT Thu Jul 25 2002,
DisconnectTime
On Tuesday, July 30, 2002, at 09:18 , Jean-Luc BEAUDET wrote:
[..]
Yu have to be aware that, generally, if yu go out the local network
FireWall
block ICMP packets...
The ping statement is not a good evidence test...
excuse me while I giggle... a bit here.
I have no idea how many times I
Hi, i correct the problem with NT, and was the server
html... Now i have another problem i'm trying to put a
image in a page (its a form image) and write over with
a database records... well my problem is: the image
when i resize to enter in a Legal size, see bad, i see
in other page that the
Hi,
How can I replace the literal nlf with a variable in the code below?
Thanks in advance.
sub parseLogLine {
$line = $_;
%searchInfo = ();
@searchInfo = split / +/, $line;
# found any listings?
$numListings = $searchInfo[8];
$numCategories = $searchInfo[10];
#
Hi everyone,
Could you point out what is wrong the count and the
while loop below?
Here is part of the script:
$sql_alias = qq( select
aliasName = l.name
from
master..syslogins l,
$eachdb..sysusers u,
$eachdb..sysalternates a
where
a.suid = l.suid
and a.altsuid =
I'm probably not understanding what exactly you needbut...as I see it,
$err holds whatever error message that you captured with a regex. So if you
want to make a variable with the same name as the literal, dereference a
variable with the name held in $err and the new var will autovivify:
This almost sounds like something that the cgi list might be able to answer
better.
-Original Message-
From: Omar Shariff [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 7:37 AM
To: [EMAIL PROTECTED]
Subject: HTML, Urgent
Hi, i correct the problem with NT, and was the server
If you just want to repolace nlf with a variable, you can just replace it
with a variable?
if ($err eq $variable){
Or else you need to be more specific about what you need.
-Original Message-
From: Larry Steinberg [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 8:06 AM
To:
Is there a better way to do this in perl:
$reportdir = '/sybase/dba/scripts/dbuser_report';
`rm -r $reportdir/*`;
__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
File::Path has a function called rmtree.
-Original Message-
From: loan tran [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: empty a dir
Is there a better way to do this in perl:
$reportdir =
Try this:
@files=glob(/sybase/dba/scripts/dbuser_report/*);
unlink(@files);
HTH,
José.
-Original Message-
From: loan tran [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 6:44 PM
To: [EMAIL PROTECTED]
Subject: empty a dir
Is there a better way to do this in perl:
$reportdir
nope that won't work. s/he wants recursive removal. not just files.
check search.cpan.org for File::Path docs or perldoc File::Path
use rmtree.
-Original Message-
From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 12:54 PM
To: loan tran; [EMAIL
Here is what I need. I hope this explains it better.
I have a script which creates a report for No Listings Found errors. I'd
like to adapt it to create a report for any ERR code condition in the
log. The errors and values are below. TIA!
Error | Value
city not in state | TSE
ZIP not in
Hello all,
I am a relative newcomer to the language (couple of months), and I totally
love it. One way or the other, I use it almost every day in my work, and even
beyond practical applications I want to improve my Perl as much as I can. I
own the Camel 3ed, and between that and a
Hi,
If I understand correctly, you want to have an image of a form underneath
text written on top, to look like the text is in the form. The problem is
the image is small and a bad resolution for printing, but high resolution
makes it just look huge and prints on more than one page.
I am not
- Original Message -
From: Tómas Guðmundsson [EMAIL PROTECTED]
To: Janek Schleicher [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 8:41 AM
Subject: Re: Help, I suppose.
okey, I made it a hash now. And everything works and that's nothing but
cool!
But what do I do to make it more
on Tue, 30 Jul 2002 17:22:53 GMT, Nkuipers wrote:
for someone who intends to pursue Perl while he's still breathing,
would you recommend purchasing the Cookbook as an investment in
skills and time-saving?
Yes, without any doubt whatsoever.
But why don't you convince yourself, and look at
On Tuesday, July 30, 2002, at 10:22 , nkuipers wrote:
[..]
for someone who intends to pursue Perl while he's still breathing, would
you
recommend purchasing the Cookbook as an investment in skills and
time-saving?
[..]
it would have been nice to have had it around when
i started playing
Hernan Marcelo Salvarezza wrote:
Hello all, i am parsing a cisco log and i can'nt find the exact
regexp,following goes the log and the script..
Jul 25 10:39:12 10.0.0.1 852: 1d23h: %VOIPAAA-5-VOIP_CALL_HISTORY:
CallLegType 2, ConnectionId 0 0 0 0, SetupTime *10:46:49.143 GMT Thu Jul
25
Do you mean something like this?
open(LOG,log.txt);
my %errs = ();
while(LOG){
chomp $_;
my($details,$err) = split(/\|/,$_);
$err =~ s/^\s+//;
$errs{$err}++ if $err;
}
print Total for each error:\n;
print -\n\n;
foreach(sort
Nkuipers wrote:
Hello all,
Hello,
I am a relative newcomer to the language (couple of months), and I totally
love it. One way or the other, I use it almost every day in my work, and even
beyond practical applications I want to improve my Perl as much as I can. I
own the Camel 3ed, and
Nkuipers wrote at Tue, 30 Jul 2002 19:22:53 +0200:
I am a relative newcomer to the language (couple of months), and I totally
love it. One way or the other, I use it almost every day in my work, and even
beyond practical applications I want to improve my Perl as much as I can. I
own the
Hi,
I have instances where I want to delete duplicate elements out of an array.
Is there an easy way to do this?
-Sarah
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
{
my %seen;
@uniq = grep { !$seen{$_}++ }, @arrayWithDups;
}
-Original Message-
From: Kirby_Sarah [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 3:04 PM
To: [EMAIL PROTECTED]
Subject: Down and dirty duplicate deleter
Hi,
I have instances where I want to delete
On Jul 30, Nikola Janceski said:
{
my %seen;
@uniq = grep { !$seen{$_}++ }, @arrayWithDups;
}
That comma will get you. Either
grep BLOCK LIST
or
grep EXPR, LIST
but never
grep BLOCK, LIST
--
Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia
Load the elements of an array into a hash. Then put the unique keys back into
the array; add other goodies like sorting if you need, but one barebones way
of doing it would be:
for (@array) { chomp $_; $hash{$_}++ }
@array = ();
@array = keys %hash;
--
To unsubscribe, e-mail: [EMAIL
Kirby_Sarah [EMAIL PROTECTED] writes:
Hi,
I have instances where I want to delete duplicate elements out of an array.
Is there an easy way to do this?
Sure,
The Perl Cookbook provides several ways - here's one: (Recipe 4.6,
page 102)
my @list = qw/one two three one two five/;
my @uniq;
On Jul 30, Jeff 'japhy' Pinyan said:
On Jul 30, Kirby_Sarah said:
I have instances where I want to delete duplicate elements out of an array.
Is there an easy way to do this?
Yes, and the FAQ tells you:
as per Japhy, corrected below
{
my %seen;
@uniq = grep { !$seen{$_}++ } @arrayWithDups;
}
## then ignore this
@uniq = map { my $temp = $_ ^ $temp; } @uniq;
undef @uniq;
# now @uniq contains no duplicates. (nor anything else). :P
-Original Message-
From: Nikola Janceski
Hi all,
I have a file that it looks as it follows:
name1
ADASDADFSDF
ADASDADFSDF
SDFDSFDSDFDF
name2
ASDFDFDFFDF
ADFEERERREWR
ADFADFQERQEWR
name1
ADASDADFSDF
SDFDSFADFDF
SDFDSFDSDFDF
name3
SDAFSDFDFF
WERWERER
WERWERER
and I want to have something like this:
name1
John, thanks for the succinct suggestion on the set in place edit
extension.I'll humbly accept additional yo here's how to simplify this
deal examples. ;^)
I could still be doing a number of things wrong, I can launch the script ,
but it 'hangs', my prompt doesn't return. I'm not getting an
Pedro A Reche wrote:
Hi all,
Hello,
I have a file that it looks as it follows:
name1
ADASDADFSDF
ADASDADFSDF
SDFDSFDSDFDF
name2
ASDFDFDFFDF
ADFEERERREWR
ADFADFQERQEWR
name1
ADASDADFSDF
SDFDSFADFDF
SDFDSFDSDFDF
name3
SDAFSDFDFF
WERWERER
WERWERER
and I want to have
65 matches
Mail list logo