Do you know where your variables are? | |
PerlMonks |
Re^2: Spreadsheet::ParseXLSX filename non Latin Tk getOpenFileby IB2017 (Pilgrim) |
on Nov 21, 2018 at 09:39 UTC ( [id://1226114]=note: print w/replies, xml ) | Need Help?? |
I think the problem with shortpath is that the module - for me quite mysteriously - sometimes does provide a short path, sometime no. Moving around the same file (or directory structure), the module may start to provide the shortpath (otherwise it returns the original path). As far as I understood, this must depend on some quite wired Windows stuff. When a shortpath is provided, Spreadsheet::ParseXLSX works smoothly. However, it is unsatisfying if it doesn't work consistently. If my path is C:/Users/DE/Desktop/号召力打了/Ршзефф.xlsx The above code selects the path okay, and displays it fine in the UI (at least with the latest Tk). Passing this path to Spreadsheet::ParseXLSX does NOT work. Shouldn't Perl and Tk resolve this internally (no sure about the layer to the OS)? If a shortpath is returned C:\Users\FC\Desktop\7373~1\B030~1.XLSthen is okay. If it is not return, I simply get again C:/Users/DE/Desktop/号召力打了/Ршзефф.xlsxwhich of course doesn't work. Can you elaborate more the idea to pass a file handle? Because, if the problem is not being able - in some circumstances - to get the shortpath, I guess I cannot have a filehandle too to pass, am I a wrong? I also tried to eliminate the Tk OpenFile and directly pass the path inside the script with: use utf8; my $workbook = $parser->parse('C:/Users/DE/Desktop/号召力打了/Ршзефф.xlsx'); This doesn't work too.
In Section
Seekers of Perl Wisdom
|
|