use strict;
use HTML::Parser 3.00 ();
Thank you for posting some HTML::Parser code. For as long as I've been
doing Perl I've only seen real HTML::Parser code a handful of times.
People are quick to say just use HTML::Parser. If most people are
anything like me, I just end up using some regexs
And as you mentioned the 256 bytes most definetely need to be sent before
anything will flush.
It is actually Internet Explorer that needs to receive 256 bytes before
displaying anything. If you test your page with a different browser (like
Mozilla), you'll see that the Flush() works with
TC Winquist wrote:
I searched CPAN for a module that would emulate clicking a link on a web
page. Let's say I know that I want to click the link a
href=r/foPhotos/a on yahoo's index page. I would like a script that
would emulate that click and load the resulting page into the web browser
[EMAIL PROTECTED] wrote:
I'm trying to test to make sure my web site is up by connecting to the
admin web page of my application. The admin web page is an ASP page and
whenever I set it up using:
use HTTP::Request;
use LWP::UserAgent;
$filename = D:\\temp\\msi.html;
$ua =
the real/regular program will then use for input. It asks the user
only two short text questions. Of course any of us would be quite happy
You could check out Win32::GUI (see HTML under .../html/lib/win32) or maybe
use Tk as an alternative GUI interface - except it may not be installed
How do I get the details of HTTP::Headers=HASH(0x1c5d150)?
What does Data::Dumper say?
use Data::Dumper;
print Dumper $r-headers;
Or just look at the keys:
foreach my $key ( keys %{$r-headers} ) {
print $key = , $r-headers-{$key}, \n;
}
___
I'm having the same problem as described in the following post. Did anyone
ever find a solution to this?
Read this post again:
http://aspn.activestate.com/ASPN/Mail/Message/1312188
Download this file:
http://www.freedb.org/software/cddbidgen.zip
Run this Perl code:
---
use strict;
use
open FOUT, /some/path/outputfile.txt;
open FILE /some/path/inputfile.txt;
open(FOUT, /some/path/outputfile.txt) or
die(Error: $!);
open(FILE /some/path/inputfile.txt) or
die(Error: $!);
whileFILE{
p=N;
next if (/.*?\|value_garbage1\|.*?/ ||
/.*?\|value_garbage2\|.*?/ ||
1. I downloaded perl542b.zip and csdpmi5b.zip
This is a MSDOS/DJGPP port of perl 5.004_02.. The file dates to 1997.
There have been many major revisions to Perl in the last 5+ years.
Can't locate Socket.pm in @INC (@INC contains: C:\PERL\LIB\PERL5
Socket.pm has been a core ( i.e. it comes
I would like to split on either a double dash or a semi colon with one
split using ( | ).
$_ = 'Hello-world;how--are--you;today';
print join \n, split /--|;/;
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe:
Would it be only semantic to escape the semicolon, or could it cause a
problem not to do so? I'm not asking to be picky, I really don't know. :)
The semi-colon is not special unless you do something like this:
m;foo|bar|\;;
___
Perl-Win32-Users
my $q = new CGI;
##
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(//, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~
PS I would settle for a free command line as well.
http://www.weihenstephan.de/~syring/win32/UnxUtils.html
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Here's a revised version of your code. It puts the data into a hash, whence
you can retrieve it in any order you like (the output line at the end is
just an example of one way).
I just put everything into the hash and dealt with it later:
---
use strict;
use warnings;
use vars qw(%H);
I've looked in the 'usual' spot (http://www.generation.net/~aminer/Perl/)
There doesn't appear to be anything on that website.
Otherwise, can any suggest the best way to get a process listing on a
Win2000 box via perl?
I have a better script someplace but maybe this will do for the time
I would like to implement the escape sequences like ( if the value
is Perl,
I'm not sure what you are asking.
perldoc URI::Escape
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe:
that somebody would actually get annoyed by the format of an e-mail.
Sometimes when people use a client like Outlook, I'm unable to quote
their message in my response. I don't think changing the font color to a
pretty shade of blue or a non-standard Times New Roman font really adds
anything. It
Is there a simpler way ?
---
use strict;
use Benchmark;
timethese (-1, {
one = 'my @one = (1..10);
my @two = (11..20);
scalar(@one);',
two = 'my @one = (1..10);
my @two = (11..20);
scalar(@two), \n;'
});
---
Benchmark: running one, two, each for at least 1 CPU
Michael D. Schleif wrote:
When I do this:
if ($csv-parse($_)) {
@array = $csv-fields;
}
print scalar @array, \n;
I get various values, because some fields in the CSV file are empty.
What I want to do is get an array with empty fields, as
[EMAIL PROTECTED] wrote:
I have two string arrays (say ar1 and ar2) and I would like to compare
them
to find out all the strings in ar1 that do not exist in ar2. What's
the fastest and
most efficient way to do that? I know I can use a couple of
for/foreach
but I am hoping that there is a
I have seen a few ok random number generator snippets but none really look
like they work too well. Take the two below arrays.
http://search.cpan.org/search?mode=modulequery=random
Some modules that may be of interest:
Math::Random
Math::TrulyRandom
I think it's just a matter of:
my $s = Set::Object-new(['a','b']);
That did it. Thank you.
- Ron
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
I like to add this to Chuck's response:
I recall reading someplace that many of the larger MS applications (
i.e. Word, Excel ) are not suitable to act as OLE servers in a
production environment such as a webserver. I don't know if this applies
to Outlook. I'll try to look on Google for where I
3) Instead of using Navigate to get a URL or file, can I use HTML
that's stored in a scalar in my source code? Can you set the Document
to an html string?
my $ie = WIn32::OLE-new('InternetExplorer.Application') or die 'Can't
create instance of IE';
my $html =
---
use strict;
use Text::Balanced qw(extract_bracketed);
my $text = '{\f2\fs20 Da biste }{\cs6\f1\cf6\lang
\{#}RES_ID{\cs6\f1\cf6\lang #\}} odaberite';
my($extracted, $remainder) = extract_bracketed($text,'{}');
print $extracted\n$remainder\n;
print(($extracted =~ /^{.*?\s(.*)\s}$/));
---
Yup - a decent faq and a reminder work rather well for most FAQ's assuming
the users read some emails before posting and didn't subscribe just to ask a
question. An auto-responder would be unpopular and put new users off, as
I don't think there is a need for Yet-Another-FAQ. I think people
Here is the situation. I have to connect to Mysql running on another
windows 2000 box. I have never done this before. Do I set this up in the
tables as another
host and use the -h parm in command shell and the host parm in my perl
scripts? or is there another way to do it?
What happens
This is what I use in a program that mimics the Unix head command:
http://www.perl.com/language/ppt/src/head/
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
I have a subroutine splitFilename that I wrote that does this for
me. It's been enhanced over time to include support for UNC, but this
is the meat of that subroutine that handles directory/path/filename
strings:
Not to be a wet blanket, but isn't File::Basename part of the core? I
looked
I have an external program that I access with the back
tick operator (`program.exe`) -it works fine, but I do
not know how to send it certain parameters through
stdin after it executes. For example what I really
want to do is to execute the program, and then send it
some data through stdin.
In linux it automatically looks in the current directory. However, with
windows, it looks to C:/Perl/lib or C:/Perl/site/lib .
All versions of Perl look in the global array @INC to see which directories
to look for files:
perl -v
Characteristics of this binary (from libperl):
Locally
My PROBLEM:
I want to insert a formatted test , I mean the resulting of the format
command . if I use write every line will go on the STDOUT
but I want to get all the columns well formatted inside the
$TextMessage.
I know it is not clearbut if you manage to understand what I am trying
My PROBLEM:
I want to insert a formatted test , I mean the resulting of the format
command . if I use write every line will go on the STDOUT
but I want to get all the columns well formatted inside the
$TextMessage.
perlform lead me to this:
---
use Carp;
sub swrite {
croak usage: swrite
Lee Goddard wrote:
I reckon PLEASE READ THE FAQ and a url should appear at the top
of every AS post, not just a URL a the bottom
No, not at the TOP! I don't need another thing to scroll down through
before I get to something meaningful.
Instead of just giving code, I like to refer
Just curious... since this was not a response but rather a new thread, was
there a particular offense that got your underwear in a bunch, or did you
just wake up a bit cranky?
The problem is that some people refuse to look for information on their own.
I can't tell you how many times this
# here I need to get contents of $ray[0x209] in DECIMAL so I can know
how
many following bytes are relevant.
Thoughts... options??
How many bytes long is the length word ?
It sounds like he just wants
$ray[ hex(0x209) ]
but unpack does seem to make more sense that splitting each line
As I am learning how to try and use modules today, I ran into a strange
Eventually this entire list is going to be PerlEx experts thanks to Scott's
posts
:-) I know how frustrating it to do simply tasks with unfamiliar software.
MY MAIN CALLING SCRIPT IN WHICH I WANT TO PASS HOST AND
to the server if the connection is severed, currently I use WS_FTP (those
who use this know what I mean).
SmartFTP is a full-featured freeware FTP client that has its own scripting
language:
http://www.smartftp.com
___
Perl-Win32-Users mailing
my ($text)=$htmlstring=~/\p\(.*)/i;
I think he wanted everything in the file. The Cookbook says:
% perl -pe 's/[^]*//g' file
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
' We have the database so lets set the properties that we want.
CompObject.Value(ConstructionEnabled) = True
CompObject.Value(ConstructorString) = Chr(34) +
Provider=SQLOLEDB;Driver={SQL Server};User
ID=momma;Password=;DATABASE=BigDog;SERVER= strServer ; + Chr(34)
Anyone heard of
Here's the VBScript version of some code I am trying to write in
PerlScript.
(I don't want to use VBScript full-time)
VBScript is a lot faster than Perlscript when it comes to ASP.
$Response-Redirect($dGatewayConfig-Item(foo));
use Data::Dumper;
$Response-Write(PRE . Dumper( $dGatewayConfig
Anyone know of a why to do this in Perl? I want to create a web
interface
where you upload a Word/Excel document and downloaded a PDF version.
Adobe provides a service that does exactly this, for a nominal fee. See
(http://cpdf.adobe.com). They handle Word, Excel, and a few other
my( $var );
while( ) {
$var = $_ if ( m!SNML_BYLINE! .. m!/SNML_BYLINE! ) == 2;
# Other line-by-line processing, if any, goes here.
}
For those who are boggled by that, its explained in the Cookbook:
while () {
if (/BEGIN PATTERN/ .. /END PATTERN/) {
# line falls
$RECNUM = 0;
$RECCOUNT = 0;
while(! $RS-EOF) {
for ( $i = 0; $i $Count; $i++ )
{
$tmp = $RS-Fields($i)-value;
$tmp =~ s/\s+$//; # trim trailing white space
$amt = $tmp;
# No datachecking here! To
$telnet-cmd("su");
su should require a password so normal users cannot
arbitrarly becomeroot.
of null value to indicate that it would not be used. I have tried passing
under, "", '', "
I think undef is your best bet:
Depth( undef, undef, 'True', undef );
sub Depth {
foreach my $param ( @_ ) {
print "$param\n" if $param;
}
}
Depth($Dir,\%Files,'',15);
The third
Does anyone know if TPJ is officially "dead" ?
When this discussion popped up on Slashdot I hurried up and ordered some
back issues and recieved them a few weeks ( well more than a few ) later.
As far as I know there aren't going to be any new issues published. Which is
a real shame, that was
templating system to be called as an exec cgi on a Unix server. My concern
is, am I creating too much overhead, in that the perl interpreter with
load every time a page loads? Is this the smartest approach under these
circumstances or am I missing something obvious (no suprise) that would
Anyone who's looked at Word docs saved as HTML
knows it's frankly terrible. I'm doing a lot of
converting these HTML docs to XML, and wonder
if anyone has any effective routines to do the
job? If not, I'll try to get some stuff on
CPAN (always fun).
@file = A;
@file = reverse A;
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
for ( $i = "001"; $i lt "501"; $i++ )
I think there's something to be said about using numbers that are really
strings as numbers. Specifically that it might not be the RightThing to do.
There seems to be an aweful lot of unnecessary conversion going on.
printf()'s formatting was designed for
close STDERR;
open (STDERR, "NUL");
That's what I wanted to do.
timethese( 5000 , {
'NumsAsStrings' = 'for ( $i = "001"; $i lt "501"; $i++ ) {print
STDERR $i}',
'NumsAsNums1' = 'for ( 1 .. 501 ) {printf STDERR "%03d", $_};',
'NumsAsNums2' = 'for ( $i=1; $i501;$i++)
I am no regex expert, but maybe it has to do with the underlying regex
engine (i.e. NFA, DFA etc) and the implicit/explicit greediness of that
engine for the specific boxes used.
Regardless of the implimentation of the engine, we should at least be
getting the same results across different
?[1;34mThis text is bold blue.
?[0mThis text is normal.
?[33;45mYellow on magenta.
?[0mThis text is normal.
in the dos box. Do I need to change something in my environment variables?
This question was asked last week(?). Phillip noted that the DOS box needs
an ANSI driver in order to know
was sent with success but i'm not receiving the message i sent to me just
Does Mail::Sender have a debug=1 parameter? Net::SMTP does. Perhaps you
could look at the output from that or check the mail in the perl@ mailbox to
see that none of the messages got returned.
I have an array that I'm adding to it every time I see an item, but it is
not adding it's appending to the array?
I did not see push() or unshift() anywhere in your code.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
Is there a more eloquent way to append .txt to a (string) variable please?
$file=$invar1;
$file.=".txt";
$file = "$invar.txt";
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
$row_elements = $#list4;
splice(@new_list,0,$row_elements,splice(@matrix,2,$row_elements));
Why not make a function called remove_row() which accepts a reference to
a matrix, and a row to delete. You've already written the code for it...
___
I use it all the time, and have found the docs more than adequate
to get started.
I think a lot of people on the list could benefit from some sample scripts.
We have Active Directory and Exchange running on several machines at the
office. I've installed the LDAP module successfully but I'm
sub Get_Input {
print "\nEnter Job Type ['L' to list]: ";
chomp($type=STDIN);
if ($type eq "l" || $type eq "L") {system "type golist.idx |
more";Get_Input()}
It looks like your making a recursive call to Get_Input() here. Why not do
something like:
# untested
print "\nEnter Job Type
i have used the code below in linux and it works fine but on porting to
win32 it's a problem
What is the problem?
eval `cat tele.conf`;
C:\cat
The name specified is not recognized as an
internal or external command, operable program or batch file.
Try this instead:
require "tele.conf";
delimited with " to '. Does it make any difference?
Not really, but as I'm parsing the code in my head I know that as soon
as I hit a ' I can expect the following text to be a string so I don't
have interpolate it in my head. There have been arguments on
comp.lang.perl.misc about single and
@operators = ("\","\\=","\=","\!\=","\\=","\");
### lets say user chose $operators[0] () and it is now stored in $fOp1
if ($fromTime $fOp1 $fTime);
{
something();
}
@op = qw| = = != = |;
if ( eval "$fromTime $op[0] $fTime" ) {
print `perldoc -f eval`;
}
What I want to do is to assign $listed_object = $form{'option'}, thus
having 'domain' as value for $listed_object. So far no problem, of
course.
But later down I have a scallar $domain (along with several others) to
which is assigned my Access field and a bit further yet, I want the
value
Not really, but as I'm parsing the code in my head I know that as soon
as I hit a ' I can expect the following text to be a string so I don't
have interpolate it in my head. There have been arguments on
comp.lang.perl.misc about single and double quotes.
I must be thinking to fast again:
# create test data matrix
@data_line = @data_matrix = ();
@data_line = ("1","26","0","0","2","","0","0","Long","","0","Thomas","Tom");
#@data_line = ("1","26","0","0","2","","0","0","Long","","0","","Tom");
push @data_matrix, [ @data_line ];
@data_line =
The only way I know of that works is to assign a specific I.P. address to
each real or virtual website.
You could run some 65,000 different sites on the same IP address as long as
each site listened for requests on a distinct port.
___
headtitleCGI Application Timeout/title/head
bodyh1CGI Timeout/h1The specified CGI application exceeded the
allowed
time for processing. The server has deleted the process.
5 minutes seems like an aweful long time for a CGI request anyway. I can't
imagine what a CGI script could be doing in
I created a DLL with VisualBasic 6.0 and want to access it with Perl.
In the documentation I found how to access the WinApi and Dlls created
with
'C' and it is working on my W2K-machine.
If you compile it as an ActiveX DLL:
use Win32;
my $object = CreateObject("NameOfProject.ClassName");
I'm not actually printing $_ but doing some more parsing, I wanted to keep
the example short.
use Data::Dumper;
my %jobs;
while ( DATA ) {
/(\d\d\d\d)/ push @{$jobs{$1}}, $1;
}
print Dumper \%jobs;
__DATA__
|-
|JT# |
||
|1780|
|1776|
|1781|
|1778|
|1785|
|1787|
|1788|
I'm trying to read the Active state FAQ
http://www.activestate.com/Support/ActivePerl/index.html
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
not elegant but this should work:
$res[0] = substr($data, 0, 3);
$res[1] = substr($data, 3);
substr() is zero based so to get the third character to the end of the line
you'll have to start at position 2:
$res[1] = substr($data, 2);
___
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
[ Grrr, just post to one list! ]
($a,$b) = $x =~ /(.{3})(.*)/;
Shouldn't you be pushing that stuff into an array as each time
[ I don't have the original posters email at this terminal ]
if you are building for speed avoid $, $' and $` as they make copies of
If you really really needed it to be fast you might look into writting it in
C using PCRE ( Perl Compatible Regular Expression ).
Does 'use strict' mean that i cannot have a global variable and is forced
to
use lexical variables everytime?
You can declare global lexical variables by doing:
my($global1,$global2);
at the top of your program. Or you can make package(?) wide variables with:
use strict;
use vars
i get the error: "invalid top directory at c:/perl/lib/file/find.pm line
279, DATA line 1.
Are you sure d:/PERLUSER is a directory on your hdd ?
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
Is it advantageous to use strict? What benefit does that offer over not
using strict?
Didn't we _just_ have this conversation? See the thread labeled 'use
strict' which was last posted to less than 12hours ago.
- Ron
___
Perl-Win32-Users mailing
This is a pure Perl implimentation of pdf2txt:
ftp://ftp.st.ryukoku.ac.jp/pub/doc-prep/acrobat/pdf2txt/pdf2txt_0.81
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
print "Value of code is: $res-code\n";
you get:
Value of rescode is: HTTP::Response=HASH(0x176517c)-code
I can do
print "Value of code is: " . $res-code . "\n";
Its more effecient to pass arguments to print() using commas:
print 'Hello ', $res-code(), ' World';
Than trying to make
Attached is a handy little program I wrote that will insure that all
variables and subroutines that have been declared within a script are
actually referenced by the script. It is handy for finding variables that
have been defined but are never used within a script.
What things does it catch
What is your Perl question?
SELECT * FROM table where 'todays_date_from_script' = 'startdate' and
"todays_date_from_script' = 'enddate'
select * from table where '$todays_date_from_script' between '$startdate'
and '$enddate';
might work but it sounds like you have a SQL problem.
I am trying to pull user input from my html page and I am getting no
where. I installed and configured ActivePerl last week. Could something
You need an HTML page to first call the script.
form action="foo.pl"
What is your first name: input type=text name=FirstName
value="Ron"br
input
use strict;
my $NUMBER = 5;
for local $NUMBER ( 0 .. 3 ) {
print $NUMBER, "\n";
}
C:\tempperl -w foo2.pl
Missing $ on loop variable at foo2.pl line 5.
Could someone explain to me why this is the case? $NUMBER is declared
elsewhere in my program as a lexical variable so I'd like to preserve
I am using lwp for POST and GET. When I send parameters,
they are not being url-encoded. For example spaces are
not being substituted with %20.
I seem to recall HTTP::Request::Common supporting url-encodings:
use HTTP::Request::Common;
$ua = LWP::UserAgent-new;
$ua-request(POST
while (ASN) {
if (/^FILEHEADER/) {
#ignore
} elsif (/^DOC HEADER(\d+)/) {
s/(DOC HEADER)(3 )/:ASNLNT: /;
print;
} elsif (/^HEADER/) {
chomp;
@fields = split(/~/, $_,);
print join('~', @fields, "\n");
while (DATA) {
chomp;
my @fields = split /~/;
while (DATA) {
Of course you'll have to change this...
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Insecure dependency in mkdir while running with -T switch at
d:\internet\root\www\domain\cgi-bin\test.pl line 777.
A search for "taint" on www.perl.com lead me to this:
http://www.perl.com/pub/doc/manual/html/pod/perlsec.html
which is also included with every installtion of Perl as
@filelist=`dir c:\\tmp\\*.doc`;
Remember that backticks return information as a scalar. So doing this
@filelist = `dir /w c:\\`;
would break your logic.
I trying to get a count of files, with a certain
pattern, from a directory.
Philip's suggestion of using glob() grep() is the right way
use strict;
use Data::Dumper;
my %hash;
OUTSIDE: while ( DATA ) {
if ( /^-/ ) {
my($name) = $_ =~ /BEGIN (.+?) -/;
while ( DATA ) {
redo OUTSIDE if /^-/;
next if $_ != /^some/;
chomp $_, push @{$hash{$name}}, [ $_ ];
}
}
}
print Dumper \%hash;
__DATA__
gives no error, but no result either.
http://velocity.activestate.com/docs/ActivePerl/CHANGES.html
"
works now with IIS5. Previously ASP would sometimes return an empty page
when the page was accessed simultaneously from multiple clients.
"
It's the latest ActiveState install (618)
Not sure if this is the appropriate list or not, but I'd like to know
if I can store an SMTP object (or a connection object, for example) in
the Session or Application object via PERl in ASP. Any ideas?
Storing an ADODB.Connection object in an an application variables is a
BadThing. ADO
for $filename (@ARGV) {
foreach my $glob (@ARGV) {
foreach my $filename ( glob $glob ) {
# your code here
}
That should allow you do to perl style globs from the command line:
*.fbi or single file names like foo.fbi
For some reason I wasn't able to do $glob
- Ron
92 matches
Mail list logo