in reply to printing variable and evaluation

without using something like DataDumper to print the variable and the value of the variable
Why not? It's a core module, you don't even have to install it.

What do you mean by "printing the variable and the value of the variable" anyway? Do you mean the variable name and its value? Like print "\$variable's value is $variable\n"; ?

Replies are listed 'Best First'.
Re^2: printing variable and evaluation
by f77coder (Beadle) on Jul 07, 2017 at 10:11 UTC
    Thanks for the help.

    I've become too reliant on modules and want to sharpen my own coding skills.

    say variable is $reallyLongPathName
    pprint($reallyLongPathName)
    would return
    $reallyLongPathName returns /remoteserver/disk5/usr/local/lib/libavcod +ec.a
      Hello,

      in my little experience, when you try to access the variable name you are in the wrong path. Use Data::Dumper or better the non CORE module Data::Dump dd method to show up your variables.

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      I've become too reliant on modules and want to sharpen my own coding skills.

      I would say that, generally, that's a logical fallacy. Modules are simply tools. Programmers are tool-makers. When you go into a machine shop you see the machinist making tools *that don't already exist* to accomplish a specific task, not crafting a hammer on his anvil (using another hammer? where did that one come from?), or turning a drill bit on his lathe.

      Learning how to select and use the existing tools (especially the ones already built into the language) is a fundamental skill for a programmer, and becoming adept at implementing such properly is every bit "sharpening your coding skills."

      In my humble opinion, your time and energy would be better invested in practicing writing clean, efficient application code, using the basic toolkit you've already selected by choosing to code in Perl.


      The way forward always starts with a minimal test.