map - What does "Useless use of a variable in void context" mean in this Perl script? -


The following script gives me what I want, but Pearl throws me a warning, "A variable in the zero reference Useless use ". what does this mean?

  Use strict; Use warnings; My $ Example = 'http \ u003a // Main \ u002egslb \ u002eku6 \ u002ecom / c0 / q7LmJPfV4DfXeTYf / 1260269522170 / 93456c39545857a15244971e35fba83a / 1279582254980 / v632 / 6/28 / a14UAJ0CeSyi3UTEvBUyMuBxg \ u002ef4v \ u002chttp \ u003a // Main \ u002egslb \ u002eku6 \ u002ecom / C 1 / q7LmJPfV4DfXeTYf / 1260269522170 / 3cb143612a0050335c0d44077a869fc0 / 1279582254980 / v642 / 10/20 / 7xo2MJ4tTtiiTOUjEpCJaByg \ u002ef4v \ u002chttp \ u003a // main \ u002egslb \ u002eku6 \ u002ecom / c2 / q7LmJPfV4DfXeTYf / 1260269522170 / 799955b45c8c32c955564ff9bc3259ea / 1279582254980 / v652 / 32/4 / 6pzkCf4iqTSUVElUA5A3PpMAoA \ u002ef4v \ u002chttp \ u003a // main \ u002egslb \ u002eku6 \ u002ecom / C-3 / q7LmJPfV4DfXeTYf / 1260269522170 / cebbb619dc61b3eabcdb839d4c2a4402 / 1279582254980 / v567 / 36/19 / MBcbnWwkSJu46UoYCabpvArA \ u002ef4v \ u002chttp \ u003a // main \ u002egslb \ u002eku6 \ U002ecom / C4 / q7LmJPfV4 DfXeTYf / 1260269522170 / 1365c39355424974dbbe4ae8950f0e73 / 1279582254980 / v575 / 17/15 / EDczAa0GTjuhppapCLFjtaQ \ u002ef4v '; My @raw_url = $ example = ~ m {(http \\ u003a. +? F4v)} g; My @processed_url = map {s {\\ u003a} {:} g, $ _; Gram {\\ u002e}, $ _ {.}; S {\\ u002d} {@} village, $ _; } @Row_Arl; Print included ("\ n", @ processed_url);  

And why does this map not work, if I leave those dollars then it seems?

  my @processed_url = map {s {\\ u003a} {:} g; Have {\\ u002e} g {.}; S {\\ u002d} {@} g; } @Row_Arl;  

When I leave those underscores of the dollar, I probably do not get anything except the flag of success "1". What am I missing? any idea? Thank you like always :)

what do you want ...

 < Code> my @processed_url = map {s {\\ u003a} {:} g; Have {\\ u002e} g {.}; S {\\ u002d} {@} g; $ _; } @Row_Arl;  

As a result, valuation gives value made from the final statement. This is the reason why we pass $ _ in the form of the previous statement that the number of replacements made by the replacement operator is returned.

In your pre-setup, you had yourself according to the following statement which is very meaningless and is warning about Pearl.

  s {\\ u003a} {:} g, $ _;  

Comments