Hello again. All of my application is written in PHP, bar 1 script which happens to create a md5 hash which is used later via PHP scripts. Problem being they dont match up.
PERL:
#$linkTrue = 'http://www.themobilemakeover.co.uk/mobile-makeover-appointment-booking-signup.php'
md5_hex($linkTrue);
And for testing purposes i did this i...
Is there a POE module that identifies PnP events in Windows? If yes, could someone provide idea code snippet?
...
Hi, what i am trying to do is get the contents of a file from another server. Since im not in tune with perl, nor know its mods and functions iv'e gone about it this way:
my $fileContents;
if( $md5Con =~ m/\.php$/g ) {
my $ftp = Net::FTP->new($DB_ftpserver, Debug => 0) or die "Cannot connect to some.host.name: $@";
$ftp->log...
The following code ...
my $user_agent = LWP::UserAgent->new;
my $request = HTTP::Request->new(GET => $url);
my $response = $user_agent->request($request);
if ($response->is_success) {
print "OK\n";
} else {
die($response->status_line);
}
.. will fail with ..
500 Can't connect to <hostname> (Bad hostname '<hostname>')
.. if ...
I'm trying to split an HTML document into its head and body:
my @contentsArray = split( /<\/head>/is, $fileContents, 1);
if( scalar @contentsArray == 2 ){
$bodyContents = $dbh->quote(trim($contentsArray[1]));
$headContents = $dbh->quote(trim($contentsArray[0]) . "</head>");
}
is what i have. $fileContents contains the HTML co...
Hi, im trying to upload HTML into a database which does work for some files but not all.
my $fileContents;
if( $md5Con =~ m/\.php$/g ) {
my $ftp = Net::FTP->new($DB_ftpserver, Debug => 0) or die "Cannot connect to some.host.name: $@";
$ftp->login($DB_ftpuser, $DB_ftppass) or die "Cannot login ", $ftp->message;
ftp->get("/" ....
I'm checking for the existence and default values of various socket options using Perl.
#!/usr/bin/perl -w
use strict;
use Socket;
if (defined(SO_BROADCAST)) {
print("SO_BROADCAST defined\n");
}
if (defined(SO_REUSEPORT)) {
print("SO_REUSEPORT defined\n");
}
When I run this it outputs:
SO_BROADCAST defined
Your vendor has ...
Hi, I have errors when inserting into my database. I have tried everything to sus this. Someone mentioned usind DBI's trace() to track what is going wrong but i cannot make heads or tails of what is going on. Could someone please take a look and see what they think might be the problem.
D
BI 1.607-ithread default trace level set to 0x0...
LS,
I'm using the following code to test the outputting of fatal errors to the browser:
use CGI;
use CGI::Carp qw(fatalsToBrowser);
die "test";
I am expecting to see some error in the browser, but there isn't any, I just get a regular 500 response. I forgot that I had custom error pages on for remote requests, and I now get Script f...
How do I create an event handler in my Perl code to intercept all File/Directory/system-based calls, so that I can untaint input in a just-in-time fashion.
I have lots of IO access in my script, and I find adding manual code for untainting cumbersome.
Can this be done without need to install a third-party CPAN module?
...
I would like to search for all instances and replace all separately, even if identical.
#!/usr/bin/perl
use strict;
use warnings;
my %dataThing;
my $x=0;
my $data = "1 - 2 - 2 - 4 - 7 - 343 - 3 - 1";
if( my @dataArray = ( $data =~ m/([0-9]+)/gis )){
foreach( @dataArray ) {
my $replace = "[thing-" . $x . "]";
# someh...
I am looking at being able to extract all plain text and analyse/amend from HTML/XHTML document and then replace if needed. Can I do this using HTML::Parser or should it be XML::Parser?
Are there any good demonstrations that anyone knows of?
...
Hi All,
I am having a html file which will accept and send the login and password. It is sent to the file login.cgi.
**
html file
**
<form method="POST" action="login.pl">
<table >
<tr>
<td>Username </td>
<td bgcolor="lightgrey"><input type="text" name="usr" size="20"></td>
</tr>
<tr>
<td>Password </td>
<td bgcolo...
Hi, im not too good when it comes to encoding and I am wanting to figure out how to return data as the same encoding it started with...
I have a file with some characters in such as '»' by the time I have edited and and inserted into database they have turned into ».
decode_entities() does nothing and encode_entities encodes the c...
I want to replace a lines that ends with 'YES' with 'YES' and replace lines that ends with 'NO'with 'NO'. I have to apply for a large file.
Input:
max. C 13 0.457 0.32 YES
max. Y 13 0.232 0.33 NO
max. S 1 0.315 0.87 NO
Output:
YES
NO
NO
...
I am reviewing a Linux based perl web application that contains a login handler with the ubiquitous
my $sth = $DB->prepare("SELECT password from passwords where userid='$userid'") or die; $sth->execute or die; ...
where $userid is initialized from (unsafe, unfiltered) web user input.
It is well known that the DBI documentation recomme...
I need to check for the existence of a file in a directory. The file name has a pattern like:
/d1/d2/d3/abcd_12345_67890.dat
In my program, I will know the file name up to abcd_
I need to write an if condition using -e option and find the files matching above given pattern.
...
I've been trying to find a good form of RPC to standardize on, but so far I've ran into a ton of walls and was wondering what the stackoverflow communities view was.
My ideal RPC would provide the following:
Somewhat wide support in other languages, in that people shouldn't have to write a custom stack to use our server
Input validat...
I'm chasing a couple of potential memory leaks in a Perl code base and I'd like to know about common pitfalls with regards to memory (mis-)management in Perl.
What are common leak patterns you have observed in Perl code?
...
I'm running SVN on a Windows server, and I'm using Perl scripts to implement some pre-commit hooks. I'm seeing the following error message from TortoiseSVN:
Error !!ScriptError!! Can't parse
line: _U path/to/files/trunk
and this is the script:
foreach my $line (`$svnlook changed -t "$txn" "$repos"`)
{
chomp($line);
if ($line...