Sponsored Content
Full Discussion: parsing argument in perl
Top Forums Shell Programming and Scripting parsing argument in perl Post 302551668 by linuxgeek on Wednesday 31st of August 2011 08:55:14 AM
Old 08-31-2011
hi hfreyer,

do you mean its like this ?

Code:
while ($ARGV[0]) {   
chomp; split;   
foreach $i (@_) {
   ...   
   }
}

how will i call my arguement1 ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script argument parsing

how to parse the command line argument to look for '@' sign and the following with '.'. In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format. rmjoe123@hotmail.com has '@' sign and followed by a '.' to be more... (1 Reply)
Discussion started by: rmjoe
1 Replies

2. UNIX for Dummies Questions & Answers

command line argument parsing

how to parse the command line argument to look for '@' sign and the following with '.'. In my shell script one of the argument passed is email address. I want to parse this email address to look for correct format. rmjoe123@hotmail.com has '@' sign and followed by a '.' to be more... (1 Reply)
Discussion started by: rmjoe
1 Replies

3. Shell Programming and Scripting

argument parsing...

Hi all, Iam a beginer in shell scripting. i need a script that can parse the arguments and store them in variables. ex: ./myScript -v v1 -h v2 -c v3...... can someone suggest me...? tnx in adv. (1 Reply)
Discussion started by: midhun_u
1 Replies

4. Shell Programming and Scripting

not null cheking of an argument in perl

Hi, I have to check whether an argument say $ARGV is not null in an if operator. Please let me know the operator. It would be great if you write a psuedo code. Thanks in advance Ammu (4 Replies)
Discussion started by: ammu
4 Replies

5. Shell Programming and Scripting

problem with spaces and argument parsing

public class HelloWorld { public static void main(String args) { System.out.println("Welcome, master"); } } and I compiled using javac HelloWorld.java ] Suppose that I execute the following command directly from the shell: java -XX:OnError="gdb - %p" HelloWorld Then it works... (8 Replies)
Discussion started by: fabulous2
8 Replies

6. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

7. Shell Programming and Scripting

Perl Parsing Argument

i wanna passing an argument which read in a file or a set of files if the files are given in the command line, otherwise use STDIN if no file argument. i got something like that, but it is not really working. so can anyone help me? which one is better to use for and how? Use perl. Thank you ... (0 Replies)
Discussion started by: mingming88
0 Replies

8. Shell Programming and Scripting

PERL need help splitting argument

If i have a script name.pl I run it like name.pl -v file.txt -t ext2 -u user -j how can I edit the array @ARGV so when my script calls $ARGV = -v file.txt $ARGV = -j (2 Replies)
Discussion started by: 3junior
2 Replies

9. Shell Programming and Scripting

How to use perl to run bash with argument?

Hi All, I want to run a bash script using perl. But they are in the different dir. #! /usr/bin/perl -w use strict; my $root=`pwd`; chomp($root); my $cmd=".$root/testdir/ft_623.sh 3 4 5 6 7"; print $cmd; my @line=`$cmd`; foreach (@line){ print $_; } ft_623.sh (0 Replies)
Discussion started by: Damon sine
0 Replies

10. Shell Programming and Scripting

Question about argument parsing in scripts

Hello all, I am relatively new to linux and bash scripting. I have what seems to be a simple question but I'm having trouble finding the answer. The question is what is the difference between the variables $@ and $*. I've seen them both used in the same context, and I've tried a number of... (4 Replies)
Discussion started by: nicthu
4 Replies
Math::Polygon::Calc(3pm)				User Contributed Perl Documentation				  Math::Polygon::Calc(3pm)

NAME
Math::Polygon::Calc - Simple polygon calculations INHERITANCE
Math::Polygon::Calc is a Exporter SYNOPSIS
my @poly = ( [1,2], [2,4], [5,7], [1, 2] ); my ($xmin, $ymin, $xmax, $ymax) = polygon_bbox @poly; my $area = polygon_area @poly; MY $L = polygon_perimeter @poly; if(polygon_is_clockwise @poly) { ... }; my @rot = polygon_start_minxy @poly; DESCRIPTION
This package contains a wide variaty of relatively easy polygon calculations. More complex calculations are put in separate packages. FUNCTIONS
polygon_area(LIST-OF-POINTS) Returns the area enclosed by the polygon. The last point of the list must be the same as the first to produce a correct result. The algorithm was found at <http://mathworld.wolfram.com/PolygonArea.html>, and sounds: A = abs( 1/2 * (x1y2-x2y1 + x2y3-x3y2 ...) polygon_bbox(LIST-OF-POINTS) Returns a list with four elements: (xmin, ymin, xmax, ymax), which describe the bounding box of the polygon (all points of the polygon are within that area. polygon_beautify([HASH], LIST-OF-POINTS) Polygons, certainly after some computations, can have a lot of horrible artifacts: points which are double, spikes, etc. This functions provided by this module beautify The optional HASH contains the OPTIONS: -Option --Default remove_between <false> remove_spikes <false> remove_between => BOOLEAN Simple points in-between are always removed, but more complex points are not: when the line is not parallel to one of the axes, more intensive calculations must take place. This will only be done when this flags is set. NOT IMPLEMENTED YET remove_spikes => BOOLEAN polygon_centroid(LIST-OF-POINTS) Returns the centroid location of the polygon. The last point of the list must be the same as the first to produce a correct result. The algorithm was found at http://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon polygon_clockwise(LIST-OF-POINTS) Be sure the polygon points are in clockwise order. polygon_contains_point(POINT, LIST-OF-POINTS) Returns true if the point is unside the closed polygon. polygon_counter_clockwise(LIST-OF-POINTS) Be sure the polygon points are in counter-clockwise order. polygon_equal(ARRAY-OF-POINTS, ARRAY-OF-POINTS, [TOLERANCE]) Compare two polygons, on the level of points. When the polygons are the same but rotated, this will return false. See polygon_same(). polygon_is_clockwise(LIST-OF-POINTS) polygon_is_closed(POINTS) polygon_perimeter(LIST-OF-POINTS) The length of the line of the polygon. This can also be used to compute the length of any line: of the last point is not equal to the first, then a line is presumed; for a polygon they must match. This is simply Pythagoras. $l = sqrt((x1-x0)^2 + (y1-y0)^2) + sqrt((x2-x1)^2+(y2-y1)^2) + ... polygon_same(ARRAY-OF-POINTS, ARRAY-OF-POINTS, [TOLERANCE]) Compare two polygons, where the polygons may be rotated wrt each other. This is (much) slower than polygon_equal(), but some algorithms will cause un unpredictable rotation in the result. polygon_start_minxy(LIST-OF-POINTS) Returns the polygon, where the point which is closest to the left-bottom corner of the bounding box is made first. polygon_string(LIST-OF-POINTS) SEE ALSO
This module is part of Math-Polygon distribution version 1.02, built on September 19, 2011. Website: http://perl.overmeer.net/geo/ LICENSE
Copyrights 2004,2006-2011 by Mark Overmeer. For other contributors see ChangeLog. 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.12.4 2011-09-19 Math::Polygon::Calc(3pm)
All times are GMT -4. The time now is 10:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy