12-20-2007
Quote:
Originally Posted by
cbkihong
The debate between the procedural and the OO camp has always been there.
Surely one is free to select his/her approach. My opinion is we should be open about others' choices even if we have a different stance personally.
Definately no issue with OO, I'm just pointing out that my advise might be flawed as I'm not very familiar with OO
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I was trying to come up with a form using perl cgi. I then created a frame to show the output of the form. Refer below
print $display_form->start_form(-title=>"Updateuser", -style => 'font-size: 9pt; color: #202020 ; font-family: Verdana', action=>"${DOCROOT}updateUser.pl",... (4 Replies)
Discussion started by: garric
4 Replies
2. Web Development
hi,i hav a form in cgi perl script.this script accepts a value from user from another html form, and depending upon this value,i need to disable /enable radio buttons in cgi-perl script wen second page is displayed on executing cgi perl script.how do i do it using javascript? (0 Replies)
Discussion started by: raksha.s
0 Replies
3. Shell Programming and Scripting
Hi Everyone,
#!/usr/bin/perl
$a = ".a!";
if ($a =~ s///g) {
print "invalid file name\n";
} else {
print "valid file name\n";
}
but the output is:
Invalid range "_-." in regex; marked by <-- HERE in m// at ./a.pl line 5.
the linux file name should be A-Z, a-z,... (8 Replies)
Discussion started by: jimmy_y
8 Replies
4. Shell Programming and Scripting
Hi
I have a successfullly run perl script (by issuing command "perl sub.pl" under shell mode) and this sub.pl will call sub.exp successfully. The sub.exp expect script is basically to login to a server and run some commands and put the output into a sub.txt file, it takes about 5 seconds to... (0 Replies)
Discussion started by: cxbest
0 Replies
5. Shell Programming and Scripting
Hi All,
I am doing a perl script validation for Phone numbers.
The normal phone number format is 01-32145.
I need to do two validations for the phone number
1) A valid phone number can have at least two digits as prefix and at least five digits as postfix. e.g. 01-01011
2) A... (5 Replies)
Discussion started by: subin_bala
5 Replies
6. Shell Programming and Scripting
print "1.readfromfile\n2.add_ex1(4,5)\n3.add_ex2(11,5)\n4.add_ex3(9,3)\n5.add_ex4(91,4)\n";
How to do it in this form:
print "1.readfromfile\n
2.add_ex1(4,5)\n
3.add_ex2(11,5)\n
4.add_ex3(9,3)\n
5.add_ex4(91,4)\n"; (3 Replies)
Discussion started by: cola
3 Replies
7. Shell Programming and Scripting
My form validation script looks like this of the form like this....
<html>
<form method="POST" action="">
<table >
<tr>
<td >Name:</td>
<td ><input type="text" name="name" size="30%"></td>
</tr>
<tr>
<td >Phone:</td>
<td ><input type="text" name="phone" size="30%"></td>
</tr>... (0 Replies)
Discussion started by: gameboy87
0 Replies
8. Programming
Hi every one,
Please excuse me if any grammatical mistakes is there.
I have multiple xml files in one directory, I need to create multiple XML files into one XML file.example files like this</p>
file1:bvr.xml
... (0 Replies)
Discussion started by: veerubiji
0 Replies
9. Shell Programming and Scripting
The Code:
#!/usr/bin/perl
use strict;
use warnings;
print "Please enter numbers, separated by commas: ";
my $data=<STDIN>; chomp $data;
my @dataset=split(/,/, $data);
my $sum = 0;
foreach my $num (@dataset) {
$sum += $num;
}
my $total_nums = scalar(@dataset);
my $mean =... (1 Reply)
Discussion started by: 300zxmuro
1 Replies
LEARN ABOUT CENTOS
attribute::params::validate
Attribute::Params::Validate(3) User Contributed Perl Documentation Attribute::Params::Validate(3)
NAME
Attribute::Params::Validate - Define validation through subroutine attributes
VERSION
version 1.08
SYNOPSIS
use Attribute::Params::Validate qw(:all);
# takes named params (hash or hashref)
# foo is mandatory, bar is optional
sub foo : Validate( foo => 1, bar => 0 )
{
...
}
# takes positional params
# first two are mandatory, third is optional
sub bar : ValidatePos( 1, 1, 0 )
{
...
}
# for some reason Perl insists that the entire attribute be on one line
sub foo2 : Validate( foo => { type => ARRAYREF }, bar => { can => [ 'print', 'flush', 'frobnicate' ] }, baz => { type => SCALAR, callbacks => { 'numbers only' => sub { shift() =~ /^d+$/ }, 'less than 90' => sub { shift() < 90 } } } )
{
...
}
# note that this is marked as a method. This is very important!
sub baz : Validate( foo => { type => ARRAYREF }, bar => { isa => 'Frobnicator' } ) method
{
...
}
DESCRIPTION
The Attribute::Params::Validate module allows you to validate method or function call parameters just like Params::Validate does. However,
this module allows you to specify your validation spec as an attribute, rather than by calling the "validate" routine.
Please see Params::Validate for more information on how you can specify what validation is performed.
EXPORT
This module exports everything that Params::Validate does except for the "validate" and "validate_pos" subroutines.
ATTRIBUTES
o Validate
This attribute corresponds to the "validate" subroutine in Params::Validate.
o ValidatePos
This attribute corresponds to the "validate_pos" subroutine in Params::Validate.
OO
If you are using this module to mark methods for validation, as opposed to subroutines, it is crucial that you mark these methods with the
":method" attribute, as well as the "Validate" or "ValidatePos" attribute.
If you do not do this, then the object or class used in the method call will be passed to the validation routines, which is probably not
what you want.
CAVEATS
You must put all the arguments to the "Validate" or "ValidatePos" attribute on a single line, or Perl will complain.
SEE ALSO
Params::Validate
AUTHOR
Dave Rolsky, <autarch@urth.org> and Ilya Martynov <ilya@martynov.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by Dave Rolsky and Ilya Martynov.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
perl v5.16.3 2014-06-10 Attribute::Params::Validate(3)