Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Unable to update correct corrosponding values in excel.

by chandantul (Scribe)
on Feb 11, 2021 at 20:33 UTC ( [id://11128268]=perlquestion: print w/replies, xml ) Need Help??

chandantul has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Unable to update correct corrosponding values in excel.
by 1nickt (Canon) on Feb 11, 2021 at 23:29 UTC

    Hi,

    I am getting below output.

    You should be getting something like:

    Possible attempt to separate words with commas at 11128268.pl line 4. Useless use of subtraction (-) in void context at 11128268.pl line 4. Argument "99999991,99999992,99999993,99999994,99999995" isn't numeric +in subtraction (-) at 11128268.pl line 4.
    If you are not, it is because you are not using strict and warnings. Why not?! Seriously, why not? Please don't post another question until you are testing code with strict and warnings enabled. You are wasting everyone's time.

    Also, the design of your application is just wrong. You should have this data in a database, or in hashes to begin with. However you are reading the data, don't read it into arrays. Read it into hashes.

    Hope this helps!


    The way forward always starts with a minimal test.

      It's worse than that. Even without strictures he should see:

      Smartmatch is experimental at ...\noname.pl line 12. Can't declare scalar dereference in "my" at ...\noname.pl line 6, near + "$no1 =" Execution of ...\noname.pl aborted due to compilation errors.

      Clearly not fit for posting. With strictures it is much more exciting:

      Possible attempt to separate words with commas at ...\noname.pl line 4 +. Possible attempt to separate words with commas at ...\noname.pl line 5 +. Possible attempt to separate words with commas at ...\noname.pl line 7 +. Useless use of a constant ("my") in void context at ...\noname.pl line + 7. Useless use of a constant ("emp") in void context at ...\noname.pl lin +e 7. Useless use of a constant ("id,my") in void context at ...\noname.pl l +ine 7. Useless use of a constant ("emp") in void context at ...\noname.pl lin +e 7. Useless use of a constant ("id,my") in void context at ...\noname.pl l +ine 7. Useless use of a constant ("emp") in void context at ...\noname.pl lin +e 7. Useless use of a constant ("id,Not") in void context at ...\noname.pl +line 7. Useless use of a constant ("my") in void context at ...\noname.pl line + 7. Useless use of a constant ("empployee,Not") in void context at ...\non +ame.pl line 7. Useless use of a constant ("my") in void context at ...\noname.pl line + 7. Useless use of a constant ("empployee,Not") in void context at ...\non +ame.pl line 7. Useless use of a constant ("my") in void context at ...\noname.pl line + 7. Useless use of a constant ("empployee,Not") in void context at ...\non +ame.pl line 7. Useless use of a constant ("my") in void context at ...\noname.pl line + 7. Smartmatch is experimental at ...\noname.pl line 15. Can't declare scalar dereference in "my" at ...\noname.pl line 9, near + "$no1 =" Global symbol "$worksheet" requires explicit package name (did you for +get to declare "my $worksheet"?) at ...\noname.pl line 13. Global symbol "$my_format" requires explicit package name (did you for +get to declare "my $my_format"?) at ...\noname.pl line 13. Global symbol "$worksheet" requires explicit package name (did you for +get to declare "my $worksheet"?) at ...\noname.pl line 19. Global symbol "$worksheet" requires explicit package name (did you for +get to declare "my $worksheet"?) at ...\noname.pl line 25. Global symbol "$r4" requires explicit package name (did you forget to +declare "my $r4"?) at ...\noname.pl line 25. Execution of ...\noname.pl aborted due to compilation errors.
      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re: Unable to update correct corrosponding values in excel.
by LanX (Saint) on Feb 11, 2021 at 20:47 UTC
    > my @array1 - qw{99999991,99999992,99999993,99999994,99999995};

    What is that supposed to mean?

    See also previous "your code makes no sense" comment from choroba

    Additionally, did you ever bother to show indented code?

    update

    this is even more cryptic

    my @array3 - qw{my emp id,my emp id,my emp id,Not my empployee,Not my empployee,Not my empployee,Not my empployee};

    the RHS is not splitted on commas but whitespace

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

    PS: @All: IMHO this smells like trolling, there is no lazy involuntary way to provide that amount of syntax errors.

      "PS: @All: IMHO this smells like trolling, there is no lazy involuntary way to provide that amount of syntax errors."

      Nah, I don't think it is trolling. I think it is just someone who has a poor grasp of Perl and no understanding of the quote operators. I'm sure what was intended was:

      my @array1 = (99999991, 99999992, 99999993 99999994, 99999995);

      If that were the only mistake in the OP's post and if there hadn't been a whole string of posts from the same OP with similar lack of effort shown I'd overlook such obvious errors, provide some help and call it a win. As it is - meh.

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
        for the records: I was focused on the '-' for assignment, not on the qw problem.

        update

        you don't even need strictures to notice that compilation error

        DB<295> my $$no1 Can't declare scalar dereference in "my" at

        ¯\_(ツ)_/¯

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11128268]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-25 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found