Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Can't figure out how to include LAST member of the array

by bliako (Prior)
on Feb 09, 2021 at 21:20 UTC ( #11128155=note: print w/replies, xml ) Need Help??


in reply to Re^4: Can't figure out how to include LAST member of the array
in thread Can't figure out how to include LAST member of the array

perlynewby the above comment was not directed to you.

Note that $i <= ($End-1) can be simplified to $i < $End and also you can use single quotes inside double quotes so that you don't have to escape double quotes print "aaa\"xx\"zzz\n"; print "aaa'xx'zzz\n";

I hope Perl helps you automate

Replies are listed 'Best First'.
Re^6: Can't figure out how to include LAST member of the array
by perlynewby (Scribe) on Feb 09, 2021 at 21:41 UTC

    I am using these suggestions to make my code read better. I updated the validation of inputs by using the die fuction. I updated the loop to include the "unless" condition( I thought this was a nice method.).

    Next step, is to take user input for each Metal polygon to be drawn and make sure these dimensions are within the predetermined limits.

    Then work on adding the dimensions of the via by user and test those against its limit.

    finally, check that via are laid out within the dimensions of each Metal that sandwiches it.

    I think I want to reference each Metal layer to a table when testing its limits by using a hash, What do you think?

      I will need a bit more info on what you are trying to do in order to tell you what I think.

      BTW, it is awkward to repeatedly test/trial-and-error a program which keeps asking user input from the command line. So, while testing your logic, perhaps you can hardcode some of those $input1, $input2. Or you can read them from a file (in this case you can test many different values), or if you are on a *nix command line printf "1\n5\n" | yourscript.pl or enter the values 1 and 5 in separate lines in myfile.txt and then cat myfile.txt | yourscript.pl

        cat myfile.txt | yourscript.pl

        Don't bother the cat. A simple I/O redirection is sufficient here:

        yourscript.pl < myfile.txt

        And as a bonus, the version without cat also works on Windows.

        See also Re: Perl output and uniq.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11128155]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2021-05-07 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (92 votes). Check out past polls.

    Notices?