How can i use switches type arguments for subroutines in perl
i want to call subroutines in perl like:
Like i know getoptions::Long is there for command line switches type arguments. So i want to know for subroutine type arguments.
hello all how can i get the type of variable in perl like
typeof(var); in javascript for instance ? to know if the variable is int or string ? (2 Replies)
Can anybody please tell me how can I determine whether a file is SYMBOLIC LINK, using the stat() function ?
So far I have this:
my @attrs = stat($fileName);
my $mode = $attrs;
What next ? (1 Reply)
I am using perl 5.8.0.
I need to check some values to see it they are floats. Our system does not have Data::Types so I can't use is_float. Is there something else that I can use? The only thing in Data is Dump.pm. I am not allowed to download anything to our system so I have to use what I have.... (3 Replies)
Hi,
My perl script takes few switches which i'm parsing through GetOpt::Long module.
My script looks like something :
myscript.pl --file="foo" --or --file="bar"
The --file switch takes 2 arguments foo and bar.
The 2 values of file are separated by --or switch. I want to ensure that... (1 Reply)
Hello experts,
How we can find out,that what is type of a scalar variable? i.e a scalar var contain a number or a string.
Thanks in advance. (8 Replies)
Hi All,
I am trying to pass an argument called "Pricelist" to a Perl function, then the function will open and print out the contents of the file named "Pricelist". But i can't seem to do it using my below code. Can any expert give some advice?
#!/usr/local/bin/perl
$DATABASE =... (1 Reply)
How to do I get the return code of a subroutine in a perl module if invoke the subroutine as standalone,
I have an module say TestExit.pm and in that i have a subroutine say myTest() which is returns 12, if i were to call the subroutine from
command line like
CASE:1 ( Without an explict... (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
This subroutine needs to check if there was a file name given on the command line. If so, return that. Otherwise... (1 Reply)
Hello.
I'm new to Perl and I am not sure how to interpret command line arguments in the program. I am writing a program similar to the Unix utility 'tail' and need to check if first argument is '-1' (1) or any arbitrary number of lines to output. How would I write an 'if' statement to check for... (4 Replies)
Discussion started by: D2K
4 Replies
LEARN ABOUT CENTOS
mail::filter
Mail::Filter(3) User Contributed Perl Documentation Mail::Filter(3)NAME
Mail::Filter - Filter mail through multiple subroutines
SYNOPSIS
use Mail::Filter;
my $filter = Mail::Filter->new( &filter1, &filter2 );
my $mail = Mail::Internet->new( [<>] );
my $mail = $filter->filter($mail);
my $folder = Mail::Folder->new( .... );
my $filter->filter($folder);
DESCRIPTION
"Mail::Filter" provides an interface to filtering Email through multiple subroutines.
"Mail::Filter" filters mail by calling each filter subroutine in turn. Each filter subroutine is called with two arguments, the first is
the filter object and the second is the mail or folder object being filtered.
The result from each filter sub is passed to the next filter as the mail object. If a filter subroutine returns undef, then "Mail::Filter"
will abort and return immediately.
The function returns the result from the last subroutine to operate on the mail object.
METHODS
Constructors
Mail::Filter->new([FILTER [, ... ]])
Create a new "Mail::Filter" object with the given filter subroutines. Each filter may be either a code reference or the name of a
method to call on the <Mail::Filter> object.
Accessors
$obj->add(FILTER [, FILTER ...])
Add the given filters to the end of the fliter list.
Processing
$obj->filter(MAIL-OBJECT | MAIL-FOLDER)
If the first argument is a "Mail::Internet" object, then this object will be passed through the filter list. If the first argument is a
"Mail::Folder" object, then each message in turn will be passed through the filter list.
$obj->folder()
While the "filter" method is called with a "Mail::Folder" object, these filter subroutines can call this method to obtain the folder
object that is being processed.
$obj->msgnum()
If the "filter" method is called with a "Mail::Folder" object, then the filter subroutines may call this method to obtain the message
number of the message that is being processed.
SEE ALSO
This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/.
AUTHORS
The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance without commitment to further development.
Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce
<Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
LICENSE
Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark Overmeer <perl@overmeer.net>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.16.3 2012-12-21 Mail::Filter(3)