I have used Email::Valid and it's simple to use as in example below:
use Email::Valid;
sub email_validation {
my $email = shift;
# return true if email address is valid.
return(Email::Valid->address( -address => "$email", -mxcheck => 1 ) ?
'1' : '0');
}
=> -O
This is the wrong list for MySQL questiosn, but I believe you are probably
looking to replace the matching record, use MySQL "INSERT REPLACE INTO
tablename".
Mimi
=> -Original Message-
=> From: S Pratap Singh [mailto:kdari...@gmail.com]
=> Sent: 20 October 2010 07:37
=> To: beginners
Hi
I need to automatically determine web users' location and provide them with
targeting products. I am aware I can capture their IP address and do DNS
lookup of some kind, but how do I find their country and city from the DNS
information.
Recently I noticed that some of the web sites I visit aut
I am using MIME::Lite::TT::HTML in my module to send emails and this worked
until I decided to use taint mode. Now Perl is not happy anymore. This is
the first time I am using taint mode, so I am not sure whether my code is
causing this exception or the underlying MIME::Lite::TT::HTML or
MIME::Lit
1
17 Query SELECT fname, lname, dob, substr(desc, 1, 200)
FROM user LEFT JOIN personal_data ON user.id = personal_data.id WHERE gender =
'male' and position = 'HR Admin' order by lname LIMIT 20
Quit
=> -Original Message-
=> F
I experienced a strange behaviour while using DBI binding for MySQL query
with LIMIT clause. My CGI program behaved so strange and the result was
always unpredictable and it took me several hours before I finally detected
the problem.
In my program I use binding as in the example below:
#
ion.nl]
=> Sent: 22 July 2010 07:52
=> To: beginners@perl.org
=> Subject: Re: Example code for storing picture in MySQL DB
=>
=> Mimi Cafe wrote:
=> >
=> > $dbh->do(qq{insert into mytable (id, pic)
=> values(1,$pic_file_name)});
=> >
=> >
=> > Any
Anyone worked on a project where they have stored pictures in MySQL db from
Perl program? I need to store pictures in MYSQL and my initial thought was
a normal insert statement. Now I did a bit of search and people are making
it completed out there. I have not tried it, but I was thinking of grabb
t;
=> On Wed, Jul 21, 2010 at 6:18 AM, Mimi Cafe
=> wrote:
=>
=> > If my program will continue to evaluate the rest of the program,
=> then is it
=> > efficient to call exit one time at the end of the program or call
=> exit as
=> > the last line
Hi Rob
I take care of everything that needs (execution errors) to be done within my
sub. Perhaps this may help explain what I have:
A the beginning of my program I test to see what needs to be done, and if a
conditional evaluates to true, then a sub is called to work and that is it. The
progra
I am testing MIME::Lite::TT::HTML and it works as expected using my html
template. What I need to understand is why it does nit send email using my
text template or both template, since I did not explicitly specify which
template to use anywhere when calling new().
I specified 2 templates below fo
July 2010 04:44
=> To: Mimi Cafe
=> Cc: 'Perl Beginners'
=> Subject: Re: Can't use string 1 as HASH ref while strict refs in use
=>
=> >>>>> "MC" == Mimi Cafe writes:
=>
=> MC> $received_arg = @_;
=>
=> read perldoc perl
I passed a has reference to my sub and tried dereferencing it within the sub
and get an exception Can't use string ("1") as HASH ref while strict refs in
use.
my %mail_parameters = (
'Fname' => "$nickname_db_exist[1]",
'Lname' => "$nickname_db_exist[2]",
'E-mail' => "$res
age-
=> From: Brandon McCaig [mailto:bamcc...@gmail.com]
=> Sent: 15 July 2010 16:18
=> To: Jeff Pang
=> Cc: Mimi Cafe; beginners@perl.org
=> Subject: Re: Track user login status
=>
=> On Sat, Jul 10, 2010 at 11:13 PM, Jeff Pang
=> wrote:
=> > Session or Cookie
Yep, I am using mod_perl. I have had a quick look at CGI::Session and it
appears to be the right way forward. Will try it.
Regards
=> Session or Cookie is a general way for this purpose.
=> Are you programming under mod_perl?
=> Even under mod_perl CGI::Session is better than
=> Apache::Session
My application has certain restriction so only users you are logged in
should have access to. I want to present a login form to users who are not
logged on. Once they have logged in they should only see 'log out' instead.
I am using Apache::Session to manage my cgi sessions, so to achieve thi
Hi,
Has anyone experience using one of these modules? Unlike Mobile::Wurfl, I
seems to me that Apache2::WURFL Filter will take all the work once
configured?
It that accurate or am I missing something in the short documentation I have
read?
Mimi
>> Do you have a list of these special characters or do you mean all
>> non-alphanumeric and non-whitespace:
>>
>> #!/usr/bin/perl
>>
>> use strict;
>> use warnings;
>>
>> while( <> ){
>>if( /[^[:space:][:alnum:]]/ ){
>> print "invalid: $_";
>>}
>> }
>>
Yes all non-alphanumeri
I am trying to match words or complete phrase (excluding special characters)
like:
1. Tom
2. Tom and Jerry
3. Audio A4 Quattro
I need to ensure users cannot feed my program with special characters so I
tried this below, but it doesn't match correctly.
$string =~ s/\
>> -Original Message-
>> I'm talking for myself here, but the way I usually do this is that I wrap
>> up each SQL query or set of related SQL queries in a subroutine.
>>
>> If the sub's going to be used as a predicate I make sure it returns
>> true/false and pass all of the relevant data
I need to evaluate a statement in an if, elsif, else block, and the
statement to evaluate in the elsif is too large as I need to run a SQL query
and act on the return value.
What would be a better way to achieve this? Putting the SQL statement
elsewhere outside the block cannot be right, so I am wo
yes, probably the space was the cause of the issue. I did not notice it
untill I went back to change the quotes.
Mimi
On 19 April 2010 19:16, Uri Guttman wrote:
> >>>>> "MC" == Mimi Cafe writes:
>
> MC> Hmm, the single quotes did help. I am used to double
Hmm, the single quotes did help. I am used to double quotes as they make me
feel I am properly quoting, but now I have learnt the hard way.
Thanks
-Original Message-
From: Thomas Bätzler [mailto:t.baetz...@bringe.com]
Sent: 19 April 2010 10:23
To: beginners@perl.org
Cc: Mimi Cafe
I get following error when trying to open a session using
Apache::Session::MySQL.
Here is what I have
38 tie %session, " Apache::Session::MySQL", undef,{
39 Handle => $dbh,
40 LockHandle => $dbh
41 };
Could not create new session: Can't loca
offset I used, so I should be fine I think.
Mimi
-Original Message-
From: John W. Krahn [mailto:jwkr...@shaw.ca]
Sent: 18 April 2010 17:03
To: Perl Beginners
Subject: Re: Extract substring from offset to space or full stop
Mimi Cafe wrote:
> I used MySQL substr function to extra 10
I am trying to test user input to ensure it contains special character or
symbols that could cause problems to my program or database.
The user will enter a keyword in the web form to search in my database, and
I want to ensure I don't play around with special character otherwise any
word or phras
Hi,
It works fine and I like it. My regex is not that good, but I can see what
is doing. I modified it a bit (to capture up till a full stop sign).
#!/usr/bin/perl
#
use strict;
use warnings;
#
my $str = "The black cat is trying to climbed the green tree. This time it
failed."; print "string: $s
I used MySQL substr function to extra 100 characters from the result of a
query, but understandably, I don't get what I want.
Now I looked at Perl's substr function and it doesn't look like it can help
me achieve what I need to.
Let's say I have:
$s = "The black cat climbed the green tr
[mailto:jimsgib...@gmail.com]
Sent: 14 April 2010 01:36
To: beginners@perl.org
Subject: Re: Nested if and elsif and else
On 4/13/10 Tue Apr 13, 2010 4:35 PM, "Mimi Cafe"
scribbled:
> I think this will work, but is it elegant.?
Yes, it will work, and yes, it is elegant, as long as it enc
I think this will work, but is it elegant.?
If (condition){
if (nexted_condition){
do this.
}
Elsif (nexted_condition){
Do that...
}
else{
Do something else.
}
}
else{
Do something else..
}
Mimi
My program is in the same directory as my module directory, but when I use
relative path in use lib, Perl doesn't find the module.
use lib qw(MyModule/), use lib qw(./MyModule/), use lib qw(MyModule) or use
lib qw(./MyModule/) # these don't work.
use lib qw(/var/www/cgi-bin/MyProject/) #
...@entropy.homelinux.org]
Sent: 16 June 2009 00:01
To: Mimi Cafe
Cc: beginners@perl.org
Subject: Re: Price comparison-agent
On Mon, 15 Jun 2009 14:10:14 +0100, Mimi Cafe
wrote:
> I am trying to write a small online price comparison-agent, but I have no
> experience doing something similar before.
> My
Yes, the search engine API should be a better way to go than parsing HTML
output. I will see whether I can use Google API (sandbox) for testing.
Thanks
-Original Message-
From: dan [mailto:d...@entropy.homelinux.org]
Sent: 16 June 2009 00:01
To: Mimi Cafe
Cc: beginners@perl.org
Subject
I am trying to write a small online price comparison-agent, but I have no
experience doing something similar before.
My intention is to query search engines for a product and try to my own
algorithm to parse the returned values for the prices and compare them.
Can any experienced develop
I am trying to write a small online price comparison-agent, but I have no
experience doing something similar before.
My intention is to query search engines for a product and try to my own
algorithm to parse the returned values for the prices and compare them.
Can any experienced developer tell me
Take a look at the CPAN module Net::SSH.
Example
use strict;
use Net::SSH qw(ssh ssh_cmd);
my @dirlist = remote_cmds("ls'");
mimi
2008/8/19 Irfan J Sayed (isayed) <[EMAIL PROTECTED]>
> Hi All,
>
> Can somebody have the sample Perl script which will fire the "ls"
> command on remote linux ma
le. I hop
e you will get answer to most of your problems.
Mimi
On 16/07/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> On Jul 15, 11:36 pm, [EMAIL PROTECTED] (Mimi Cafe) wrote:
> > remote_user() or user_name() should give you the name of the user if you
> are
>
Someone in Timbuktu goes to your web site using their favourite browser
and you want to know their authenticated user name, it that right?
The user's web browser sends this information to your web application
and assuming you are using CGI.pm you can say:
$remote_user_login = remote_user();
In t
remote_user() or user_name() should give you the name of the user if you are
using CGI.pm.
Mimi
On 15/07/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> > [EMAIL PROTECTED] wrote:
> >
> > > On Jul 15, 12:32 am, [EMAIL PROTECTED]
You don't need the do {} block at all. You could print the same message
without the do{}.
my $dbh = DBI->connect( "DBI:mysql::$mysql_host", $mysql_user, $mysql_pass )
or die "statement before dying\nCan't connect, $DBI::errstr\n";
Above should do for you.
Mimi
On 20/06/2008, John W. Krahn
You could use the CPAN module Net::SSH
http://search.cpan.org/~ivan/Net-SSH-0.09/SSH.pm.
- Install the module on you local PC.
- Create a non-privileged user on the remote server
- Create SSH certificate for the non-privileged user on the remote machine
- Use the non-privileged user to run remote
Perl is warning you that your variables have not been declared. You need to
declare the @array and $temp as my @array, my $temp.
Also, the second element of @array is $array[1] not @array[1].
Mimi
On 23/06/2008, luke devon <[EMAIL PROTECTED]> wrote:
>
> Hi ,
>
> I tried to capture some data in S
use print to write all types of data as with text files, but it never
worked correctly.
Mimi
On 20/06/2008, Beginner <[EMAIL PROTECTED]> wrote:
>
> On 20 Jun 2008 at 11:43, Mimi Cafe wrote:
> > I need to write a cgi program to enable our users to upload files using
> the
>
You may have to parse @ARGV manually depending on how arguments are passed
to your script. For instance, if you script is run as follows:
perl ack --name foo --pkg bar -relno 1234
then @ARGV will contain "--name, foo, --pkg, bar, -relno, 1234," and you
will have to parse the list for the values you
I am trying to compare one or more lists against a master record file and
find out elements of the master record which are not in the other records
and compile new lists of elements which are in the master data, but not
found in the other records.
This works to fine, but the output list is random
(){
chomp;
$inputclient{"s_"} = $_;
}
close INPUTFH;
#$outputfile = "NOT_IN" . "$outputfile";
my $outputfile = $list;
my (@missing_clients, %outputclient);
open (OUTPUTFILE, ">", $outputfile) || die "Could not open $outputfile:
$!\n";
r die "Could not open $supplied for
> reading: $!\n # This does not works! Error: No such file or directory
>
Mimi
>
>
>
>
> On 29/05/2008, Ken Foskey <[EMAIL PROTECTED]> wrote:
>>
>> On Thu, 2008-05-29 at 11:45 +0100, Mimi Cafe wrote:
>>
>&g
29/05/2008, Ken Foskey <[EMAIL PROTECTED]> wrote:
>
> On Thu, 2008-05-29 at 11:45 +0100, Mimi Cafe wrote:
>
> my script is in the same directory as my files, but it cannot find the file
> ABC.txt in open() below.
>
> foreach my $supplied (@ARGV){
> # Output file
my script is in the same directory as my files, but it cannot find the file
ABC.txt in open() below.
foreach my $supplied (@ARGV){
# Output file name set of element currently processed.
# Open file to read from.
open (INPUTFILE, "<", "$supplied") or die "Could not open $supplied: $!\n";
# Erro
Hi,
I am trying to process a directory and all subdirectory recursively and
generate a list as the Unix command "ls -R" will display, but this seems not
to behave as it should.
My script only goes as far as processing the directory and the 1 step below
not more.
I have some like, but the script g
50 matches
Mail list logo